I am using the levenshtein algorithm to satisfy these requirements:
When N characters Looking at the word, my words dictionary suggesting improvement as the dictionary is as follows:
Each dictionary word in N word, which is a 1 letter of difference with the word found. Examples: Found word: Bina, Dictionary of the word: beer
Each dictionary words in the word N, which are N characters equal to the common word. Example: Found Word: Bear, Glossary Words: Bear
Each N-1 letter N-1 letter has the equivalent N-1 characters of a similar word. Example: found word: bear, dictionary word: bears
I am using the implementation of the Levanticin algorithm in C ++, when the word levenshatin number is 1 (which for all three cases is the Levantheiten number ), But then how can I choose the word for suggestion? I read about Boer-Moore-Horspool and Noth-Morris-Prat, but I'm not sure how any of them can be helpful.
#include & lt; String & gt; # Include & lt; Vector & gt; # Include & lt; Algorithm & gt; using namespace std; Int levenshatin (constant string and s1, const string and s2) {string :: size_type N1 = s1.length (); String :: size_type N2 = s2.length (); String :: size_type I, j; Of vector & lt; Int & gt; T (N2 + 1); For (i = 0; i <= N2; i ++) t [i] = i; For (i = 0; i
You may also want to add to your reading.
It was a time when I read it, but I remember that it is very similar to your writing.
Comments
Post a Comment