检查词典中的单词 [英] checking words in a dictionary

查看:130
本文介绍了检查词典中的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要确定一个未知的5或6个字母的字符串是否是一个有效的字,即在字典中。我可以将字符串/单词提交到一个在线词典,但是我需要检查这个字符串/单词,每次都会有所不同,约为100到150次。这似乎有点耗时。

I need to determine if an unknown 5 or 6 letter string is a valid word, i.e. is in the dictionary. I could submit the string/word to an online dictionary, but I need to check this string/word, which will be different each time, for about 100 to 150 times. This seems to be a bit time consuming.

我的下一个想法是尝试获得我自己的字典程序。它将需要在Java中,因为我的程序是用Java编写的。 Java API是否已经有一个类来执行此操作?我可以得到一个人已经编码的血统,我所要做的就是提交字符串/单词吗?

My next thought would be to try to get a dictionary program of my own. It would need to be in Java as my program is written in Java. Does the Java API already have a class for doing this? Can I get a descent one that someone has already coded, and all I have to do is submit the string/word to it?

我的程序没有被用于拼写检查。我想写一个程序来解密乱七八糟的拼图,当我陷入一个乱码的话。感谢您的建议。

My program is not being used for spell checking. I want to write a program for unscrambling the Jumbled Word Puzzles when I get stuck on a scrambled word. Thanks for your suggestions.

推荐答案

如果您不需要拼写检查,这将非常简单。只需将所有单词加载到HashSet中,然后检查该集合是否包含要测试的单词。有大量单词列表可用。

If you don't need spell checking this would be really easy. Just load all your words into a HashSet and then check to see if that set contains the word you want to test. There are tons of word lists available.

如果您需要拼写检查器,请检查aspell或其他免费API。

If you do need a spell checker, then check out aspell or other free APIs.

这篇关于检查词典中的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆