Example usage for org.apache.lucene.analysis.compound CompoundWordTokenFilterBase DEFAULT_MIN_WORD_SIZE

List of usage examples for org.apache.lucene.analysis.compound CompoundWordTokenFilterBase DEFAULT_MIN_WORD_SIZE

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.compound CompoundWordTokenFilterBase DEFAULT_MIN_WORD_SIZE.

Prototype

int DEFAULT_MIN_WORD_SIZE

To view the source code for org.apache.lucene.analysis.compound CompoundWordTokenFilterBase DEFAULT_MIN_WORD_SIZE.

Click Source Link

Document

The default for minimal word length that gets decomposed

Usage

From source file:at.ac.tuwien.ifs.lupu.GreedyDictionaryCompoundWordTokenFilterFactory.java

public GreedyDictionaryCompoundWordTokenFilterFactory(Map<String, String> args) {
    super(args);/*from  ww  w . j  a  va2  s . c  om*/
    dictFile = require(args, "dictionary");
    minWordSize = getInt(args, "minWordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE);
    minSubwordSize = getInt(args, "minSubwordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
    maxSubwordSize = getInt(args, "maxSubwordSize", CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE);
    if (!args.isEmpty()) {
        throw new IllegalArgumentException("Unknown parameters: " + args);
    }
}

From source file:org.apache.solr.analysis.DictionaryCompoundWordTokenFilterFactory.java

License:Apache License

@Override
public void init(Map<String, String> args) {
    super.init(args);
    assureMatchVersion();//from w  w  w  .j  a  v a2  s  . co  m
    dictFile = args.get("dictionary");
    if (null == dictFile) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Missing required parameter: dictionary");
    }

    minWordSize = getInt("minWordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE);
    minSubwordSize = getInt("minSubwordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
    maxSubwordSize = getInt("maxSubwordSize", CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE);
    onlyLongestMatch = getBoolean("onlyLongestMatch", true);
}

From source file:org.apache.solr.analysis.HyphenationCompoundWordTokenFilterFactory.java

License:Apache License

@Override
public void init(Map<String, String> args) {
    super.init(args);
    assureMatchVersion();/*www.  j a  v  a2  s  .com*/
    dictFile = args.get("dictionary");
    if (args.containsKey("encoding"))
        encoding = args.get("encoding");
    hypFile = args.get("hyphenator");
    if (null == hypFile) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Missing required parameter: hyphenator");
    }

    minWordSize = getInt("minWordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE);
    minSubwordSize = getInt("minSubwordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
    maxSubwordSize = getInt("maxSubwordSize", CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE);
    onlyLongestMatch = getBoolean("onlyLongestMatch", false);
}

From source file:org.elasticsearch.analysis.common.AbstractCompoundWordTokenFilterFactory.java

License:Apache License

protected AbstractCompoundWordTokenFilterFactory(IndexSettings indexSettings, Environment env, String name,
        Settings settings) {/*from   w w w .j a  va2  s  .c  om*/
    super(indexSettings, name, settings);

    minWordSize = settings.getAsInt("min_word_size", CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE);
    minSubwordSize = settings.getAsInt("min_subword_size",
            CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
    maxSubwordSize = settings.getAsInt("max_subword_size",
            CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE);
    onlyLongestMatch = settings.getAsBoolean("only_longest_match", false);
    wordList = Analysis.getWordSet(env, settings, "word_list");
    if (wordList == null) {
        throw new IllegalArgumentException(
                "word_list must be provided for [" + name + "], either as a path to a file, or directly");
    }
}

From source file:org.elasticsearch.index.analysis.compound.AbstractCompoundWordTokenFilterFactory.java

License:Apache License

@Inject
public AbstractCompoundWordTokenFilterFactory(Index index, @IndexSettings Settings indexSettings,
        Environment env, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettings, name, settings);

    minWordSize = settings.getAsInt("min_word_size", CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE);
    minSubwordSize = settings.getAsInt("min_subword_size",
            CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
    maxSubwordSize = settings.getAsInt("max_subword_size",
            CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE);
    onlyLongestMatch = settings.getAsBoolean("only_longest_match", false);
    wordList = Analysis.getWordSet(env, settings, "word_list", version);
    if (wordList == null) {
        throw new ElasticsearchIllegalArgumentException(
                "word_list must be provided for [" + name + "], either as a path to a file, or directly");
    }// w  ww  .java  2s . c o m
}