Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
Possible duplicate: mathematica.stackexchange.com/q/13142/5 –  rm -rf May 23 '13 at 6:35
    
@rm-rf ha,I saw one WolframAlpha["appals", {{"Input", 1}, "Plaintext"}] return "appalls (English word)" –  HyperGroups May 23 '13 at 6:41
    
'appals' might be the US spelling, 'appalls' the British... –  cormullion May 23 '13 at 7:16

1 Answer 1

up vote 1 down vote accepted

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

DeleteDuplicates@
 Flatten[WordData[#, "InflectedForms"][[All, 2]] & /@ WordData[]]
share|improve this answer
    
do you know how to obtain all the prefix or suffix, can it be retrieved form WordData? –  HyperGroups May 29 '13 at 15:54
    
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 –  Michael Hale May 29 '13 at 16:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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