Android Word Validation

廉价感情. 提交于 2019-12-02 07:25:28

问题


I am developing an Android word game like Scrabble. I need to check if the word a user enters is correct (aka is a String entered by a user equal to an existing word).

All that Android seems to offer is a spell-checking api which provides you with some suggestions based on your input. This just seems silly to me because these suggestions are actual words and there seems to be nothing in the api that is able to check if a word exists in it's dictionary.

I understood that there are some other web based solutions for my problem but I can't assume these web-based solutions will work forever and that users have a stable network connection. Also, my game is time based so the only proper solution would be a local one.

So, (how) can I validate a word (String) locally on Android?

inb4 it can't be done properly and wordnik is the best solution for me


回答1:


Load your dictionary into SQLite and use a query to determine if it's valid.



来源:https://stackoverflow.com/questions/23428401/android-word-validation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!