Random Words API not returning real words

975 views
Skip to first unread message

Robert Burdick

unread,
Jul 7, 2011, 8:24:11 PM7/7/11
to Wordnik API
Hi everyone:

I am trying to use the random words API to generate random real
English words. Most of the words that come back whenever I use the
API are nonsense. Here are the arguments I'm passing to
http://api.wordnik.com/v4/words.json/randomWords:

"includePartOfSpeech": "noun,verb,adjective,definite-
article,conjunction",
"excludePartOfSpeech": "proper-noun,proper-noun-plural,proper-noun-
posessive,suffix,family-name,idiom,affix",
"hasDictionaryDef": " true",
"maxLength": "7",
"limit": "26"},

Can anyone recommend a better combination of arguments to get real
words back?

Kumanan Rajamanikkam

unread,
Jul 8, 2011, 2:25:27 AM7/8/11
to <wordnik-api@googlegroups.com>
Hi Robert,

Can you try setting the following query params?

minCorpusCount => Indicates the word frequency. i.e. number of times the word occurred in our examples corpus. Specifying an higher value for this ensures that more common words are returned.

minDictionaryCount => Indicates the number of definitions we have for any given word. For example, a value of 20 would ensure that more common words are returned because there has to be at least 20 definitions across all the dictionaries in our system for the word to qualify.

Here is a request with minCorpusCount=10000 and minDictionaryCount=20. Play with these values and see if that helps.

http://api.wordnik.com/v4/words.json/randomWords?minCorpusCount=10000&minDictionaryCount=20&excludePartOfSpeech=proper-noun,proper-noun-plural,proper-noun-posessive,suffix,family-name,idiom,affix&hasDictionaryDef=true&includePartOfSpeech=noun,verb,adjective,definite-article,conjunction&limit=26&maxLength=7&api_key=<your-api-key>

-Kumanan

Robert Burdick

unread,
Jul 10, 2011, 12:30:57 PM7/10/11
to Wordnik API
That works, thanks! Also, how can I tell the API to get more high
frequency articles like "and", "the", "or", etc. I'm basically trying
to return words that a young kid like a fifth grader would typically
use when writing, etc.

On Jul 7, 11:25 pm, Kumanan Rajamanikkam <kuma...@wordnik.com> wrote:
> Hi Robert,
>
> Can you try setting the following query params?
>
> minCorpusCount => Indicates the word frequency. i.e. number of times the word occurred in our examples corpus. Specifying an higher value for this ensures that more common words are returned.
>
> minDictionaryCount => Indicates the number of definitions we have for any given word. For example, a value of 20 would ensure that more common words are returned because there has to be at least 20 definitions across all the dictionaries in our system for the word to qualify.
>
> Here is a request with minCorpusCount=10000 and minDictionaryCount=20. Play with these values and see if that helps.
>
> http://api.wordnik.com/v4/words.json/randomWords?minCorpusCount=10000...<your-api-key>
>
> -Kumanan
>
> On Jul 7, 2011, at 5:24 PM, Robert Burdick wrote:
>
> Hi everyone:
>
> I am trying to use the random words API to generate random real
> English words.  Most of the words that come back whenever I use the
> API are nonsense.  Here are the arguments I'm passing tohttp://api.wordnik.com/v4/words.json/randomWords:

Tony Tam

unread,
Jul 12, 2011, 4:53:33 PM7/12/11
to Wordnik API
Hi Robert, yes, you can set the minCorpusCount to find high-frequency
words. Unfortunately that number is absolute against our entire
corpus and the corpus grows daily. I'd recommend an approach where
you periodically query the frequency for "the" using the /word.
{format}/{word}/frequency api and set a lower limit based on some
fraction of that count.

Tony
Reply all
Reply to author
Forward
0 new messages