本文整理汇总了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);
}
示例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;
}
示例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");
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例9: TwitterKoreanTokenizerBase
public TwitterKoreanTokenizerBase(){super(AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY);}