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


Java AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY属性代码示例

本文整理汇总了Java中org.apache.lucene.util.AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY属性的典型用法代码示例。如果您正苦于以下问题:Java AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY属性的具体用法?Java AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY怎么用?Java AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.lucene.util.AttributeFactory的用法示例。


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

示例1: MeCabKoTokenizer

/**
 * MeCabKoTokenizer 생성자.
 * Default AttributeFactory 사용.
 * 
 * @param option Tokenizer 옵션
 * @param appender PosAppender
 * 복합명사 분해가 필요없는 경우, TokenGenerator.NO_DECOMPOUND를 입력한다.
 */
public MeCabKoTokenizer(
    TokenizerOption option,
    PosAppender appender) {
  this(
      AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY,
      option,
      appender);
}
 
开发者ID:jaepil,项目名称:mecab-ko-lucene-analyzer,代码行数:16,代码来源:MeCabKoTokenizer.java

示例2: parseQuery

@Override
  public List<String> parseQuery(String queryStr) {
    // tokenize queryStr, remove stop word, stemming
	List<String> tokens = new ArrayList<String>();
	AttributeFactory factory = AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY;
	Tokenizer tokenizer = new StandardTokenizer(factory);
	tokenizer.setReader(new StringReader(queryStr));
	CharArraySet stopWords = EnglishAnalyzer.getDefaultStopSet();
    TokenStream tokenStream = new StopFilter(tokenizer, stopWords);
//    StringBuilder sb = new StringBuilder();
    CharTermAttribute charTermAttribute = tokenizer.addAttribute(CharTermAttribute.class);
    try {
    	tokenStream.reset();
        while (tokenStream.incrementToken()) {
            String term = charTermAttribute.toString();
            
            tokens.add(term);
//            sb.append(term + " ");
        }
        tokenStream.end();
        tokenStream.close();

        tokenizer.close();  
	} catch (IOException e) {
		e.printStackTrace();
	}
//	System.out.println("QU="+ sb.toString());
	return tokens;	
  }
 
开发者ID:mzdu,项目名称:AdSearch_Endpoints,代码行数:29,代码来源:QueryParserImpl.java

示例3: newAttributeFactory

/** Returns a random AttributeFactory impl */
public static AttributeFactory newAttributeFactory(Random random) {
  switch (random.nextInt(3)) {
    case 0:
      return TokenStream.DEFAULT_TOKEN_ATTRIBUTE_FACTORY;
    case 1:
      return Token.TOKEN_ATTRIBUTE_FACTORY;
    case 2:
      return AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY;
    default:
      throw new AssertionError("Please fix the Random.nextInt() call above");
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:BaseTokenStreamTestCase.java

示例4: MyTokenStream

public MyTokenStream(Random random, int tokensPerDoc) {
  super(new MyAttributeFactory(AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY));
  this.tokensPerDoc = tokensPerDoc;
  addAttribute(TermToBytesRefAttribute.class);
  bytes.length = TOKEN_LEN;
  this.random = random;
  nextSave = TestUtil.nextInt(random, 500000, 1000000);
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:Test2BTerms.java

示例5: OpenKoreanTextTokenizer

public OpenKoreanTextTokenizer() {
    super(AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY);
}
 
开发者ID:open-korean-text,项目名称:elasticsearch-analysis-openkoreantext,代码行数:3,代码来源:OpenKoreanTextTokenizer.java

示例6: MockTokenizer

public MockTokenizer(CharacterRunAutomaton runAutomaton, boolean lowerCase, int maxTokenLength) {
    this(AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY, runAutomaton, lowerCase, maxTokenLength);
}
 
开发者ID:jprante,项目名称:elasticsearch-analysis-opennlp,代码行数:3,代码来源:MockTokenizer.java

示例7: PreAnalyzedTokenizer

public PreAnalyzedTokenizer(Reader reader, PreAnalyzedParser parser) {
  // we don't pack attributes: since we are used for (de)serialization and dont want bloat.
  super(AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY, reader);
  this.input = reader;
  this.parser = parser;
}
 
开发者ID:europeana,项目名称:search,代码行数:6,代码来源:PreAnalyzedField.java

示例8: NumericTokenStream

/**
 * Creates a token stream for numeric values using the default <code>precisionStep</code>
 * {@link NumericUtils#PRECISION_STEP_DEFAULT} (16). The stream is not yet initialized,
 * before using set a value using the various set<em>???</em>Value() methods.
 */
public NumericTokenStream() {
  this(AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY, NumericUtils.PRECISION_STEP_DEFAULT);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:NumericTokenStream.java

示例9: TwitterKoreanTokenizerBase

public TwitterKoreanTokenizerBase(){super(AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY);} 
开发者ID:jobplanet,项目名称:elasticsearch-twitter-korean,代码行数:1,代码来源:TwitterKoreanTokenizerBase.java


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