Is there a good way to define a word even if it is written in javascript?

I have a bunch of words (mostly places like Stockholm and London) and a bunch of strings. for example, "I want to go from Stockholm to London." I want to know what words are in the lines.

I am currently using .indexOf to accomplish this task.

Is there a library, method, function, etc. in javascript that identifies words with misspelled words?

+4
source share
6 answers

https://github.com/epeli/underscore.string#readme

Check the distance function levenshtein _.levenshtein(string1, string2) . It can be used to calculate the distance between too lines.

+2
source

I found this JS library http://www.javascriptspellcheck.com/ which should check the spelling in several languages

+2
source

After reading the above, I'm not sure if I'm clear about what you are trying to do ... but regarding your final question about identifying words that are misspelled - I would look at a java script spellchecker . And as a side note. Often people try to use soundex when they want to count words that are spelled correctly and incorrectly.

+2
source

php has a levenshtein function by default. You can use this method using the PHPJS library.

finding the Levenshtein distance between the word and the dictionary of correct words, you can get the word with the least levenshtein level from the missed word. This will most likely be the correct spelling for a particular word.

0
source

In the past, I used the MissPlete library, which uses the Jaro-Winkler distance by default algorithm.

It has no dependencies (not even jQuery), which I really appreciate.

0
source

All Articles