Analysis: Phonetic filter to support `cologne` encoder, closes #942.

This commit is contained in:
kimchy 2011-05-18 13:43:10 +03:00
parent 44595c06c6
commit 229c03e33f
2 changed files with 8 additions and 2 deletions

View File

@ -52,10 +52,16 @@ public class PhoneticTokenFilterFactory extends AbstractTokenFilterFactory {
this.encoder = new Metaphone(); this.encoder = new Metaphone();
} else if ("soundex".equalsIgnoreCase(encoder)) { } else if ("soundex".equalsIgnoreCase(encoder)) {
this.encoder = new Soundex(); this.encoder = new Soundex();
} else if ("caverphone1".equalsIgnoreCase(encoder)) {
this.encoder = new Caverphone1();
} else if ("caverphone2".equalsIgnoreCase(encoder)) {
this.encoder = new Caverphone2();
} else if ("caverphone".equalsIgnoreCase(encoder)) { } else if ("caverphone".equalsIgnoreCase(encoder)) {
this.encoder = new Caverphone(); this.encoder = new Caverphone2();
} else if ("refined_soundex".equalsIgnoreCase(encoder) || "refinedSoundex".equalsIgnoreCase(encoder)) { } else if ("refined_soundex".equalsIgnoreCase(encoder) || "refinedSoundex".equalsIgnoreCase(encoder)) {
this.encoder = new RefinedSoundex(); this.encoder = new RefinedSoundex();
} else if ("cologne".equalsIgnoreCase(encoder)) {
this.encoder = new ColognePhonetic();
} else if ("double_metaphone".equalsIgnoreCase(encoder) || "doubleMetaphone".equalsIgnoreCase(encoder)) { } else if ("double_metaphone".equalsIgnoreCase(encoder) || "doubleMetaphone".equalsIgnoreCase(encoder)) {
DoubleMetaphone doubleMetaphone = new DoubleMetaphone(); DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
doubleMetaphone.setMaxCodeLen(settings.getAsInt("max_code_len", doubleMetaphone.getMaxCodeLen())); doubleMetaphone.setMaxCodeLen(settings.getAsInt("max_code_len", doubleMetaphone.getMaxCodeLen()));

View File

@ -13,7 +13,7 @@ dependencies {
runtime 'org.elasticsearch:es-trove:3.0.0rc1' runtime 'org.elasticsearch:es-trove:3.0.0rc1'
runtime 'org.elasticsearch:es-jsr166y:20110209' runtime 'org.elasticsearch:es-jsr166y:20110209'
runtime 'commons-codec:commons-codec:1.4' runtime 'commons-codec:commons-codec:1.5'
runtime 'joda-time:joda-time:1.6.1' runtime 'joda-time:joda-time:1.6.1'
runtime 'org.mvel:mvel2:2.1.beta2' runtime 'org.mvel:mvel2:2.1.beta2'