kenganal / bjspell

Automatically exported from code.google.com/p/bjspell
0 stars 0 forks source link

Error in parse funcion #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi everybody!
I've found an error in BJSpell.js inside the parse function. This code:

if((re === "." || new RegExp(re + "$").test(seek)) && this.words[seek]){
result = true;
break;
}

has to be like this:

if((re === "." || new RegExp(re + "$").test(seek)) && this.words[seek] && new 
RegExp(".*" + select + ".*").test(this.words[seek])){                           
 result = true;
break;
}

otherwise the suffix rules will be applicate words that are not involved by the 
rule.

Cheers

Original issue reported on code.google.com by quattord...@gmail.com on 18 Oct 2012 at 10:32