当前位置: 首页>>代码示例>>Java>>正文


Java CJKWidthFilter类代码示例

本文整理汇总了Java中org.apache.lucene.analysis.cjk.CJKWidthFilter的典型用法代码示例。如果您正苦于以下问题:Java CJKWidthFilter类的具体用法?Java CJKWidthFilter怎么用?Java CJKWidthFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CJKWidthFilter类属于org.apache.lucene.analysis.cjk包,在下文中一共展示了CJKWidthFilter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testKatakanaReadingsHalfWidth

import org.apache.lucene.analysis.cjk.CJKWidthFilter; //导入依赖的package包/类
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[] { "コンヤ", "ハ", "ロバート", "センセイ", "ト", "ハナシ", "タ" }
  );
}
 
开发者ID:europeana,项目名称:search,代码行数:14,代码来源:TestJapaneseReadingFormFilter.java

示例2: testRomajiReadingsHalfWidth

import org.apache.lucene.analysis.cjk.CJKWidthFilter; //导入依赖的package包/类
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" }
  );
}
 
开发者ID:europeana,项目名称:search,代码行数:14,代码来源:TestJapaneseReadingFormFilter.java

示例3: testKatakanaReadingsHalfWidth

import org.apache.lucene.analysis.cjk.CJKWidthFilter; //导入依赖的package包/类
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[] { "コンヤ", "ハ", "ロバート", "センセイ", "ト", "ハナシ", "タ" }
  );
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:14,代码来源:TestJapaneseReadingFormFilter.java

示例4: testRomajiReadingsHalfWidth

import org.apache.lucene.analysis.cjk.CJKWidthFilter; //导入依赖的package包/类
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" }
  );
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:14,代码来源:TestJapaneseReadingFormFilter.java

示例5: create

import org.apache.lucene.analysis.cjk.CJKWidthFilter; //导入依赖的package包/类
@Override
public TokenStream create(TokenStream tokenStream) {
    return new CJKWidthFilter(tokenStream);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:CJKWidthFilterFactory.java

示例6: create

import org.apache.lucene.analysis.cjk.CJKWidthFilter; //导入依赖的package包/类
@Override
public TokenStream create(TokenStream input) {
  return new CJKWidthFilter(input);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:CJKWidthFilterFactory.java


注:本文中的org.apache.lucene.analysis.cjk.CJKWidthFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。