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


Java Type类代码示例

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


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

示例1: reset

import org.apache.lucene.analysis.ja.JapaneseTokenizer.Type; //导入依赖的package包/类
@Override
public void reset() throws IOException {
    updateUserDictionary();

    if (dictionaryTimestamp > tokenizerTimestamp) {
        if (VERBOSE) {
            System.out.println("Update KuromojiTokenizer ("
                    + tokenizerTimestamp + "," + dictionaryTimestamp
                    + ")");
        }
        if (userDictionary != null) {
            try {
                tokenizerTimestamp = dictionaryTimestamp;
                userDictionaryField.set(tokenizer, userDictionary);
                final TokenInfoFST userFst = userDictionary.getFST();
                userFSTField.set(tokenizer, userFst);
                userFSTReaderField.set(tokenizer,
                        userFst.getBytesReader());
                @SuppressWarnings("unchecked")
                final
                EnumMap<Type, Dictionary> dictionaryMap = (EnumMap<Type, Dictionary>) dictionaryMapField.get(tokenizer);
                dictionaryMap.put(Type.USER, userDictionary);
            } catch (final Exception e) {
                throw new IllegalStateException(
                        "Failed to update the tokenizer.", e);
            }
        }
    }

    final Reader inputPending = getInputPending();
    if (inputPending != ILLEGAL_STATE_READER) {
        tokenizer.setReader(inputPending);
    }
    tokenizer.reset();
}
 
开发者ID:codelibs,项目名称:elasticsearch-analysis-ja,代码行数:36,代码来源:ReloadableKuromojiTokenizerFactory.java

示例2: Token

import org.apache.lucene.analysis.ja.JapaneseTokenizer.Type; //导入依赖的package包/类
public Token(int wordId, char[] surfaceForm, int offset, int length, Type type, int position, Dictionary dictionary) {
  this.wordId = wordId;
  this.surfaceForm = surfaceForm;
  this.offset = offset;
  this.length = length;
  this.type = type;
  this.position = position;
  this.dictionary = dictionary;
}
 
开发者ID:europeana,项目名称:search,代码行数:10,代码来源:Token.java

示例3: isKnown

import org.apache.lucene.analysis.ja.JapaneseTokenizer.Type; //导入依赖的package包/类
/**
 * Returns true if this token is known word
 * @return true if this token is in standard dictionary. false if not.
 */
public boolean isKnown() {
  return type == Type.KNOWN;
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:Token.java

示例4: isUnknown

import org.apache.lucene.analysis.ja.JapaneseTokenizer.Type; //导入依赖的package包/类
/**
 * Returns true if this token is unknown word
 * @return true if this token is unknown word. false if not.
 */
public boolean isUnknown() {
  return type == Type.UNKNOWN;
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:Token.java

示例5: isUser

import org.apache.lucene.analysis.ja.JapaneseTokenizer.Type; //导入依赖的package包/类
/**
 * Returns true if this token is defined in user dictionary
 * @return true if this token is in user dictionary. false if not.
 */
public boolean isUser() {
  return type == Type.USER;
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:Token.java


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