Java 类org.apache.lucene.analysis.cjk.CJKWidthFilter 实例源码

项目:search    文件:TestJapaneseReadingFormFilter.java   
public void testKatakanaReadingsHalfWidth() throws IOException {
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer tokenizer = new JapaneseTokenizer(newAttributeFactory(), reader, null, true, JapaneseTokenizer.Mode.SEARCH);
      TokenStream stream = new CJKWidthFilter(tokenizer);
      return new TokenStreamComponents(tokenizer, new JapaneseReadingFormFilter(stream, false));
    }
  };
  assertAnalyzesTo(a, "今夜はロバート先生と話した",
      new String[] { "コンヤ", "ハ", "ロバート", "センセイ", "ト", "ハナシ", "タ" }
  );
}
项目:search    文件:TestJapaneseReadingFormFilter.java   
public void testRomajiReadingsHalfWidth() throws IOException {
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer tokenizer = new JapaneseTokenizer(newAttributeFactory(), reader, null, true, JapaneseTokenizer.Mode.SEARCH);
      TokenStream stream = new CJKWidthFilter(tokenizer);
      return new TokenStreamComponents(tokenizer, new JapaneseReadingFormFilter(stream, true));
    }
  };
  assertAnalyzesTo(a, "今夜はロバート先生と話した",
      new String[] { "kon'ya", "ha", "robato", "sensei", "to", "hanashi", "ta" }
  );
}
项目:NYBC    文件:TestJapaneseReadingFormFilter.java   
public void testKatakanaReadingsHalfWidth() throws IOException {
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer tokenizer = new JapaneseTokenizer(reader, null, true, JapaneseTokenizer.Mode.SEARCH);
      TokenStream stream = new CJKWidthFilter(tokenizer);
      return new TokenStreamComponents(tokenizer, new JapaneseReadingFormFilter(stream, false));
    }
  };
  assertAnalyzesTo(a, "今夜はロバート先生と話した",
      new String[] { "コンヤ", "ハ", "ロバート", "センセイ", "ト", "ハナシ", "タ" }
  );
}
项目:NYBC    文件:TestJapaneseReadingFormFilter.java   
public void testRomajiReadingsHalfWidth() throws IOException {
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer tokenizer = new JapaneseTokenizer(reader, null, true, JapaneseTokenizer.Mode.SEARCH);
      TokenStream stream = new CJKWidthFilter(tokenizer);
      return new TokenStreamComponents(tokenizer, new JapaneseReadingFormFilter(stream, true));
    }
  };
  assertAnalyzesTo(a, "今夜はロバート先生と話した",
      new String[] { "kon'ya", "ha", "robato", "sensei", "to", "hanashi", "ta" }
  );
}
项目:Maskana-Gestor-de-Conocimiento    文件:TestJapaneseReadingFormFilter.java   
public void testKatakanaReadingsHalfWidth() throws IOException {
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer tokenizer = new JapaneseTokenizer(reader, null, true, JapaneseTokenizer.Mode.SEARCH);
      TokenStream stream = new CJKWidthFilter(tokenizer);
      return new TokenStreamComponents(tokenizer, new JapaneseReadingFormFilter(stream, false));
    }
  };
  assertAnalyzesTo(a, "今夜はロバート先生と話した",
      new String[] { "コンヤ", "ハ", "ロバート", "センセイ", "ト", "ハナシ", "タ" }
  );
}
项目:Maskana-Gestor-de-Conocimiento    文件:TestJapaneseReadingFormFilter.java   
public void testRomajiReadingsHalfWidth() throws IOException {
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer tokenizer = new JapaneseTokenizer(reader, null, true, JapaneseTokenizer.Mode.SEARCH);
      TokenStream stream = new CJKWidthFilter(tokenizer);
      return new TokenStreamComponents(tokenizer, new JapaneseReadingFormFilter(stream, true));
    }
  };
  assertAnalyzesTo(a, "今夜はロバート先生と話した",
      new String[] { "kon'ya", "ha", "robato", "sensei", "to", "hanashi", "ta" }
  );
}
项目:elasticsearch_my    文件:CJKWidthFilterFactory.java   
@Override
public TokenStream create(TokenStream tokenStream) {
    return new CJKWidthFilter(tokenStream);
}
项目:lams    文件:CJKWidthFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new CJKWidthFilter(input);
}
项目:Elasticsearch    文件:CJKWidthFilterFactory.java   
@Override
public TokenStream create(TokenStream tokenStream) {
    return new CJKWidthFilter(tokenStream);
}
项目:search    文件:CJKWidthFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new CJKWidthFilter(input);
}
项目:NYBC    文件:CJKWidthFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new CJKWidthFilter(input);
}
项目:read-open-source-code    文件:CJKWidthFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new CJKWidthFilter(input);
}
项目:read-open-source-code    文件:CJKWidthFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new CJKWidthFilter(input);
}
项目:read-open-source-code    文件:CJKWidthFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new CJKWidthFilter(input);
}
项目:Maskana-Gestor-de-Conocimiento    文件:CJKWidthFilterFactory.java   
@Override
public TokenStream create(TokenStream input) {
  return new CJKWidthFilter(input);
}