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
Post a Comment