开发者

Is it possible to automate generation of wrong choices from a correct word?

开发者 https://www.devze.com 2023-01-08 16:17 出处:网络
The following list contains 1 correct word called \"disastrous\" and other incorrect words which sound like the correct word?

The following list contains 1 correct word called "disastrous" and other incorrect words which sound like the correct word?

A. disastrus
B. disasstrous开发者_如何学Go
C. desastrous
D. desastrus
E. disastrous
F. disasstrous

Is it possible to automate generation of wrong choices given a correct word, through some kind of java dictionary API?


No, there is nothing related in java API. You can make a simple algorithm which will do the job.

Just make up some rules about letters permutations and doubling and add generated words to the Set until you get enough words.


There are a number of algorithms for matching words by sound - 'soundex' is the one that springs to mind, but I remember uncovering a few when I did some research on this a couple of years ago. I expect the problem you would find is that they take a word and return a value that represents how the word sounds so you can see if two spellings sound similar (so the words in the question should generate similar values); but I expect doing the reverse, i.e. taking the value and generating similar sounding spellings, would be quite hard.

0

精彩评论

暂无评论...
验证码 换一张
取 消