How to add a dictionary check function in JavaScript? -


i'm trying code program randomly generates 7-letter strings , checks whether they're valid words in english dictionary. realise create array has every word of english language in , searches 7-letter string in array - but, since sounds pretty time-consuming, better way of doing this?

thanks!

you don't need array, you'll need hashtable, luckily javascript objects implemented hashtables, lookup should faster ( o(1) vs o(n) )than lookup in array. search web english dictionary, make object out of , check if string in there. see no other straightforward ways test if word english. there no logical tests can right ? being english word definition means somewhere mentioned in 'the' english dictionary.

in dictionary approach you'll won't match conjugations of verbs, translation api catch them.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -