обновление 3 < /strong> < /h2>
сделано. Ниже приведен код, который наконец прошел все мои тесты. Опять же, это смоделировано после модифицированной версии Алгоритма Стива Ханов Марило Васконсело. Спасибо всем, что помогло! < /P>
/**
* Computes the minimum Levenshtein Distance between the given word (represented as an array of Characters) and the
* words stored in theTrie. This algorithm is modeled after Steve Hanov's blog article "Fast and Easy Levenshtein
* distance using a Trie" and Murilo Vasconcelo's revised version in C++.
*
* http://stevehanov.ca/blog/index.php?id=114
* http://murilo.wordpress.com/2011/02/01/ ... trie-in-c/
*
* @param ArrayList word - the characters of an input word as an array representation
* @return int - the minimum Levenshtein Distance
*/
private int computeMinimumLevenshteinDistance(ArrayList word) {
theTrie.minLevDist = Integer.MAX_VALUE;
int iWordLength = word.size();
int[] currentRow = new int[iWordLength + 1];
for (int i = 0; i
Подробнее здесь: https://stackoverflow.com/questions/486 ... ation-java