作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我想构建一个 trie 来记录短语。因此单位是单词而不是字符。我通过谷歌找到了一个很有前途的实现 here .但是根据他们的documentation , 没有 add
功能。我想知道如何在 trie 中添加/插入单词?提前致谢!
最佳答案
此 trie 实现提供与 dict 相同的接口(interface)。您的 add
函数将只是 mytrie[key] = value
。
关于python - 为什么我不能通过 pygtrie 在 trie 中添加单词?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42875886/
我想构建一个 trie 来记录短语。因此单位是单词而不是字符。我通过谷歌找到了一个很有前途的实现 here .但是根据他们的documentation , 没有 add 功能。我想知道如何在 trie
我是一名优秀的程序员,十分优秀!