4
$\begingroup$

How to extend the default dictionary.txt for Dictionarylookup to all words?

For example, first I

wordsExtended=WordData[]~Join~DictionaryLookup["*"]//Union;
wordsExtended//Length

However, after reloading the dictionary.txt some words are omitted, for example:

In[73]:= DictionaryLookup["appals"]
Out[73]= {}
In[74]:= WordData["appals"]
Out[74]= {{appal,Verb,Frighten},{appal,Verb,Nauseate}}

How to add all such words like #appals# to dictionary.txt?

One method: Tuples to create a word verified by WordData, which takes too much time. For

In[78]:= Binomial[26,7]
Out[78]= 657800

Second method:

listAlls = # <> "s" & /@ DictionaryLookup["*"];
wordsToExport = Select[listAlls, Length[WordData@#] > 1 &];
In[81]:= Complement[wordsToExport,DictionaryLookup["*"]]//Length
Out[81]= 2580

I get 2580 new words for dictionary.txt, but how to get all prefix and suffix such like s pre es... and so on.

$\endgroup$
3
  • $\begingroup$ Possible duplicate: mathematica.stackexchange.com/q/13142/5 $\endgroup$
    – rm -rf
    Commented May 23, 2013 at 6:35
  • $\begingroup$ @rm-rf ha,I saw one WolframAlpha["appals", {{"Input", 1}, "Plaintext"}] return "appalls (English word)" $\endgroup$ Commented May 23, 2013 at 6:41
  • $\begingroup$ 'appals' might be the US spelling, 'appalls' the British... $\endgroup$
    – cormullion
    Commented May 23, 2013 at 7:16

1 Answer 1

2
$\begingroup$

You can retrieve all of the inflected forms of words (plurals, conjugations, etc) that WordData knows with:

DeleteDuplicates@
 Flatten[WordData[#, "InflectedForms"][[All, 2]] & /@ WordData[]]
$\endgroup$
2
  • $\begingroup$ do you know how to obtain all the prefix or suffix, can it be retrieved form WordData? $\endgroup$ Commented May 29, 2013 at 15:54
  • $\begingroup$ Well not all inflections in English consist of just adding a prefix or suffix. The rules are more consistent if you look at phonology as opposed to spelling, for example, berry->berries. A few English grammar Wikipedia articles probably contain enough information to meet your needs for common prefixes and suffixes: en.wikipedia.org/wiki/English_plural $\endgroup$ Commented May 29, 2013 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.