Hi, I have made the algorithm more general. Now we get really all the possible combinations of replacements including multiple and different substitutions inside a word.
For example, for "tel·lenovela" we get four suggestions: "telenovel·la, tel·lenovela, telenovela, tel·lenovel·la". Note that there are replacements L->L·L and L·L->L at the same time, which are necessary to find the right suggestion, the first one. The idea is that once we find a possible replacement we start two new searches recursively: one with the replacement and another without the replacement. Both new searches are done from an increased index, not from the start of the word. The "candidates" are added to the list only when we reach a terminal branch where no replacement is possible. The key and replacement pairs are now iterated inside getAllReplacements(), so we can get different kinds of replacements inside the word. This works fine with all my examples in Catalan. Regards, Jaume
Speller.java
Description: Binary data
------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________ Languagetool-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/languagetool-devel
