Thesaurus in the format word 14 Apr key 14 Apr_1 pos noun synonyms Pan American Day 14 Apr word 1 Aug key 1 Aug_1 pos noun synonyms Lammas Day 1 Aug Lammas fetch https notebook xbdev net var scripts en_thesaurus txt then response response text then data console log Size of file data length let words let lines data split n for let k 0 k lines length k if lines k trim length 1 continue let line JSON parse lines k words line word line synonyms words line word line key words line word line pos end for k console log Num lookup words Object keys words length console log words sad console log words cat console log words dirty console log done console log ready wordnet format a able 5 00 00 capable 00 able capable a abnormal 3 00 00 abnormal a absent 3 00 00 absent a absolute 3 00 00 absolute perfect or complete fetch https notebook xbdev net var scripts wordnet txt then response response text then data console log Size of file data length let words let lines data split n for let k 0 k lines length k lines k lines k trim if lines k length 1 continue let parts lines k split a n v let type parts 0 split 0 a n v let word parts 0 split 1 able word word split 0 word word replace words word synonyms let rec parts 1 rec rec replace rec rec trim words word synonyms push rec let rec2 parts 2 if rec2 length 0 let aa rec2 split for let kk 0 kk aa length kk words word synonyms push aa kk trim end for k console log Num of words Object keys words length console log words happy console log words cat console log words mouse console log words exciting console log words hot console log words dirty console log words important console log words pressure console log done console log ready script Regular expression version wordnet format a able 5 00 00 capable 00 able capable a abnormal 3 00 00 abnormal a absent 3 00 00 absent a absolute 3 00 00 absolute perfect or complete fetch https notebook xbdev net var scripts wordnet txt then response response text then data console log data length let words let lines data split n for let k 0 k lines length k lines k lines k trim if lines k length 1 continue let line lines k var mm line match a v r n a zA Z 0 9 a zA Z 0 9 0 v force 2 38 00 force move something forcibly 1 v 2 force 2 38 00 3 force 4 move something forcibly let word mm 2 split 0 let rec mm 3 words word synonyms words word synonyms push rec if mm 4 undefined mm 4 let alt mm 4 split for let kk 0 kk alt length kk words word synonyms push alt kk trim end for k console log Object keys words length console log words happy console log words cat console log words mouse console log words exciting console log words hot console log words dirty console log words important console log words pressure console log done console log ready script
ush aa kk trim end for k console log Num of words Object keys words length console log words happy console log words cat console log words mouse console log words exciting console log words hot console log words dirty console log words important console log words pressure console log done console log ready script Regular expression version wordnet format a able 5 00 00 capable 00 able capable a abnormal 3 00 00 abnormal a absent 3 00 00 absent a absolute 3 00 00 absolute perfect or complete fetch https notebook xbdev net var scripts wordnet txt then response response text then data console log data length let words let lines data split n for let k 0 k lines length k lines k lines k trim if lines k length 1 continue let line lines k var mm line match a v r n a zA Z 0 9 a zA Z 0 9 0 v force 2 38 00 force move something forcibly 1 v 2 force 2 38 00 3 force 4 move something forcibly let word mm 2 split 0 let rec mm 3 words word synonyms words word synonyms push rec if mm 4 undefined mm 4 let alt mm 4 split for let kk 0 kk alt length kk words word synonyms push alt kk trim end for k console log Object keys words length console log words happy console log words cat console log words mouse console log words exciting console log words hot console log words dirty console log words important console log words pressure console log done console log ready script