我们能否找到给定的单词是否存在于英语词典中? [英] Can we find whether the given word is existing in english dictionary or not?

查看:81
本文介绍了我们能否找到给定的单词是否存在于英语词典中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

输入将是一个字符串,我将更改字符串中的字符。

但是,形成的字符串必须出现在英语词典中。



我尝试了什么:



我在c#

The input will be a string and i will be changing the characters in the string.
but, the formed string must be present in english dictionary.

What I have tried:

I didn't have any idea for this in c#

推荐答案

你必须有一个字典来比较字符串。您最好的选择是将Scrabble中有效的所有单词收集到一个列表中,并将您的字符串与该列表进行比较。你有最小/最大允许的字符串大小吗?



如果你不想将所有这些单词存储在硬盘上的文件中,你可以尝试找到一个公开可用的网络服务,如果这个单词在拼字游戏中有效,则返回true / false,但是我不倾向于帮助你找到超出这个相当圣人建议的服务:



谷歌是你的朋友。



这可能会有所帮助,也可能没有帮助,但我发布了一个.Net Anagrams游戏(实际上是两个),利用了一个系统每个文件包含一定长度为3到10个字符的单词。你可以从那开始。



Anagrams2 - 一个简单的WPF游戏应用程序 [ ^ ]
You have to have a dictionary to compare the string against. Your best bet is to gather up all of the words that are valid in Scrabble into a single list, and compare your string against that list. Do you have a minimum/maximum allowed string size?

If you don't want to store all of those words in a file on your hard drive, you could try to find a publicly available web service that returns true/false if the word is valid in scrabble, but I'm not inclined to help you find such a service beyond this rather sage advice:

Google is your friend.

This may or may not help, but I posted a .Net Anagrams game (two actually) that utilizes a system of files that each contain words of a certain length from three to ten characters. You could start with that.

Anagrams2 - A Simple WPF Game Application[^]


在此处查看答案:英语词典+词库API C# [ ^ ]

另一个选项可能是 NetSpell - .net拼写检查器下载| SourceForge.net [ ^ ]
See answers here: English dictionary + Thesaurus API C#[^]
Another option might be NetSpell - .net Spell Checker download | SourceForge.net[^]


这里有一个关于CP的Anagram编码挑战。包括我在内的许多解决方案都使用了一个包含近20万字的单词列表来进行有效性测试。以下链接指向一个包含单词列表链接的解决方案:编码挑战:生成anagrams。 [ ^ ]。



查看其他解决方案,了解哪一个适合您的需求。
There was an Anagram coding challenge here on CP. Many of the solutions, including mine, used a word list with almost 1/2 million words to do the validity test. Here is a link to one solution that has a link to the word list: Coding challenge: generate anagrams.[^].

Check out the other solutions to see which one suits your needs.


这篇关于我们能否找到给定的单词是否存在于英语词典中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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