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

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

Introduction

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

Prototype

int DEFAULT_MAX_SUBWORD_SIZE

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

Click Source Link

Document

The default for maximal length of subwords that get propagated to the output of this filter

Usage

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

public GreedyDictionaryCompoundWordTokenFilterFactory(Map<String, String> args) {
    super(args);/*  ww w  .  ja  v a2s.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  ww  w.ja  v a 2s  .  c  o 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();/* ww w  .  ja  v  a 2s .c o m*/
    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   ww w .j ava 2s  .  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");
    }//from  w  w  w . jav a2s .co  m
}