add name as another setting to set on snowball, not just language

This commit is contained in:
kimchy 2011-02-17 22:22:34 +02:00
parent c67912e259
commit 60578aef4d
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ public class SnowballAnalyzerProvider extends AbstractIndexAnalyzerProvider<Snow
@Inject public SnowballAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
super(index, indexSettings, name);
String language = settings.get("language", "English");
String language = settings.get("language", settings.get("name", "English"));
Set<?> defaultStopwords = defaultLanguageStopwords.containsKey(language) ? defaultLanguageStopwords.get(language) : ImmutableSet.<Set<?>>of();
Set<?> stopWords = Analysis.parseStopWords(settings, defaultStopwords);

View File

@ -39,7 +39,7 @@ public class SnowballTokenFilterFactory extends AbstractTokenFilterFactory {
@Inject public SnowballTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
super(index, indexSettings, name);
this.language = settings.get("language", "English");
this.language = settings.get("language", settings.get("name", "English"));
}
@Override public TokenStream create(TokenStream tokenStream) {