}
return filters;
}
private AnalyzerDef createAnalyzerDef(Map<String, Object> analyzerDef) {
AnnotationDescriptor analyzerDefAnnotation = new AnnotationDescriptor( AnalyzerDef.class );
for ( Map.Entry<String, Object> entry : analyzerDef.entrySet() ) {
if ( entry.getKey().equals( "tokenizer" ) ) {
AnnotationDescriptor tokenizerAnnotation = new AnnotationDescriptor( TokenizerDef.class );
@SuppressWarnings("unchecked")
Map<String, Object> tokenizer = (Map<String, Object>) entry.getValue();
for ( Map.Entry<String, Object> tokenizerEntry : tokenizer.entrySet() ) {
if ( tokenizerEntry.getKey().equals( "params" ) ) {
addParamsToAnnotation( tokenizerAnnotation, tokenizerEntry );
}
else {
tokenizerAnnotation.setValue( tokenizerEntry.getKey(), tokenizerEntry.getValue() );
}
}
analyzerDefAnnotation.setValue( "tokenizer", AnnotationFactory.create( tokenizerAnnotation ) );
}
else if ( entry.getKey().equals( "filters" ) ) {