Java 类org.apache.lucene.analysis.icu.ICUFoldingFilter 实例源码

项目:elasticsearch_my    文件:IcuFoldingTokenFilterFactory.java   
@Override
public TokenStream create(TokenStream tokenStream) {

    // The ICUFoldingFilter is in fact implemented as a ICUNormalizer2Filter.
    // ICUFoldingFilter lacks a constructor for adding filtering so we implemement it here
    if (unicodeSetFilter != null) {
        Normalizer2 base = Normalizer2.getInstance(
                ICUFoldingFilter.class.getResourceAsStream("utr30.nrm"),
                "utr30", Normalizer2.Mode.COMPOSE);
        UnicodeSet unicodeSet = new UnicodeSet(unicodeSetFilter);

        unicodeSet.freeze();
        Normalizer2 filtered = new FilteredNormalizer2(base, unicodeSet);
        return new org.apache.lucene.analysis.icu.ICUNormalizer2Filter(tokenStream, filtered);
    }
    else {
        return new ICUFoldingFilter(tokenStream);
    }
}
项目:elasticsearch-icu    文件:IcuFoldingTokenFilterFactory.java   
@Override
public TokenStream create(TokenStream tokenStream) {
    if (unicodeSetFilter != null) {
        // The ICUFoldingFilter is in fact implemented as a ICUNormalizer2Filter.
        // ICUFoldingFilter lacks a constructor for adding filtering so we implemement it here
        Normalizer2 base = Normalizer2.getInstance(ICUFoldingFilter.class.getResourceAsStream("utr30.nrm"),
                "utr30", Normalizer2.Mode.COMPOSE);
        UnicodeSet unicodeSet = new UnicodeSet(unicodeSetFilter);
        unicodeSet.freeze();
        Normalizer2 filtered = new FilteredNormalizer2(base, unicodeSet);
        return new org.apache.lucene.analysis.icu.ICUNormalizer2Filter(tokenStream, filtered);
    } else {
        return new ICUFoldingFilter(tokenStream);
    }
}
项目:elasticsearch-icu    文件:IcuFoldingCharFilterFactory.java   
@Inject
public IcuFoldingCharFilterFactory(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettings, name);
    String normalizationName = "utr30";
    Normalizer2.Mode normalizationMode = Normalizer2.Mode.COMPOSE;
    this.normalizer =  Normalizer2.getInstance(ICUFoldingFilter.class.getResourceAsStream("utr30.nrm"),
            normalizationName, normalizationMode);
}
项目:elasticsearch-analysis-german    文件:IcuFoldingTokenFilterFactory.java   
@Override
public TokenStream create(TokenStream tokenStream) {
    if (unicodeSetFilter != null) {
        // The ICUFoldingFilter is in fact implemented as a ICUNormalizer2Filter.
        // ICUFoldingFilter lacks a constructor for adding filtering so we implemement it here
        Normalizer2 base = Normalizer2.getInstance(ICUFoldingFilter.class.getResourceAsStream("utr30.nrm"),
                "utr30", Normalizer2.Mode.COMPOSE);
        UnicodeSet unicodeSet = new UnicodeSet(unicodeSetFilter);
        unicodeSet.freeze();
        Normalizer2 filtered = new FilteredNormalizer2(base, unicodeSet);
        return new org.apache.lucene.analysis.icu.ICUNormalizer2Filter(tokenStream, filtered);
    } else {
        return new ICUFoldingFilter(tokenStream);
    }
}
项目:search    文件:ICUFoldingFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new ICUFoldingFilter(input);
}
项目:NYBC    文件:ICUFoldingFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new ICUFoldingFilter(input);
}
项目:read-open-source-code    文件:ICUFoldingFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new ICUFoldingFilter(input);
}
项目:read-open-source-code    文件:ICUFoldingFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new ICUFoldingFilter(input);
}
项目:Maskana-Gestor-de-Conocimiento    文件:ICUFoldingFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new ICUFoldingFilter(input);
}