如何访问 iPhone/iPod 的内置(可能是预测性)字典
我正在编写一个应用程序,它有自己的文本输入,覆盖通常的键盘。我想包括某种单词补全。出于显而易见的原因,如果我不必提供自己的词典,而是可以使用已有的词典,那将是最好的。
有谁知道如何访问这本词典吗?有可能吗?如果是的话:它有什么能力?
提前致谢
I'm writing an app that has it's own text input, overriding the usual keyboard. I want to include some kind of word completition. It would, for obvious reasons, be best, if I wouldn't have to supply my own dictionary, but instead could use the one already in place.
Does anyone know how to access this dictionary? Is it even possible? And if it is: what capabilities does it have?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嗨,我正在寻找同样的东西 - 但到目前为止还没有成功。然而我发现的是C中的T9算法。您需要的是可以从 字典文件 创建的字典数据库,例如作为 dict.cc 或使用 Arun Prabhakar 的样本词典。
希望这有帮助。
请参阅下面的 Arun Prabhakar 网站 中的代码(我我不是此代码的作者!):
Hi I am looking for the same - so far unsuccessful though. What I found however is the T9 algorithm in C. What you would need is the dictionary database which you could create from a dictionary file such as dict.cc's or use Arun Prabhakar's sampel dictionary.
Hope this helped.
See code from Arun Prabhakar's website bleow (I am not the author of this code!):
如果您只需要拼写检查功能,也许您可以使用 UITextChecker ?
过去,我需要快速访问完整的词典,我的解决方案是在我的应用程序中嵌入离线词典。后来我把它变成了一个其他人可以使用的静态库(只需支付少量费用)。它没有“预测”功能,但如果您确实需要一本完整的词典,可以在 www.lexicontext 上查看。 .com
If you just need spell-checking capabilities, maybe you can use
UITextChecker
?In the past I needed quick access to a full-blown dictionary and my solution was to embed an offline dictionary inside my app. I later turned it into a static library that others can use (for a small fee). It doesn't have "predictive" capabilities, but if you do need a full-blown dictionary you can check it out at www.lexicontext.com