对于Trie,我有几个函数,我希望生成以下输出:
/*Putting a string into an Entry item I created: parses string, removes
syllable stresses and adds a comma in between the word and its
pronunciation*/
The Line is: MARIBELLE,MA RAH B EY L
/*splits the line into a list using ',' as a delimiter*/
The Entry is Saved as: ['MARIBELLE', 'MA RAH B EY L']
/*self.entry[0]*/
The Word is: MARIBELLE
/*self.entry[1].split(" ")*/
Its Pronunciation is: ['MA', 'RAH', 'B', 'EY', 'L']
/*desired output with word from a word list formatted the same way as the
input line (word sy la bles); here I know it should choose: LORABELLE LO
RAH B EY L*/
The Word With Longest Common Rhyming Suffix is: LORABELLE****
然而,我最长的常用后缀函数正在吐出:
The Longest Rhyming Suffix is: LEYBRAHLO
换言之,它是在寻找与输入最接近的匹配项,但我没有返回单词本身,而是只能让它按照我(糟糕的)语音拼写的方式向后吐出。我希望它检查反向匹配,因为这是应该告诉我什么单词(s)与输入押韵(后缀检查),我不太关心得到正确的顺序打印音节,如果我可以让它返回原来的单词,音节听起来出来
为了学术诚信,我不能在这里发布任何重要的代码示例,但我想知道是否有人能让我走上正轨
热释光;在trie中找到一个与我输入的单词押韵的单词后,如何让trie的函数返回那个押韵单词而不是它的发音
目前没有回答
相关问题 更多 >
编程相关推荐