Hey!
Step 1: Get the words
- I manually scraped tough English words from the internet and stored it in a json file.
Step 2: Finding a dictionary API
- I used the Merriam Webster Dictionary API
- Understanding the API seems a bit intimidating..Let's make a request with the API and check out the json response we receive:
https://www.dictionaryapi.com/api/v3/references/thesaurus/json/umpire?key=yourkey
So at the topmost level we have 5 keys -
I. meta
- The key refers to metadata(a shorthand representation of data) and gives a shorthand representation of the word.
It contains:
- "id" - the word itself (here, "umpire")
- "uuid" - universally unique identifier ( a string)
- "src" - source data set (like collegiate thesaurus)
- "section" - indicates section (alpha - alphabetical, geog - geographic etc..)
- "stems" - other words which stem from this word - lists all of the word's variants - querying the API with this word would also return the same response
- "syns" - synonyms
II. hwi
- means head word information
- "hw" : string headword
III. fl
- means functional label
- tells grammatical function(noun, adj etc..)
IV. def
- groups together all sense sequences and verb dividers(transitive/intransitive)
- sseq - sense sequence contains a series of senses
sense - a unit which contains all content relevant to a particular meaning
dt - defining text is an array which contains:
- ["text", string] - string is definition of word
- ["vis", [{object}]] - verbal illustration is an example sentence and each object may contain the members:
"t" : string text of verbal illustration
V. shortdef
a highly abridged version of the main definition section, consisting of just the definition text for the first three senses.
That's all for now.
Bye!
@stratospher
Top comments (0)