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


Java Version.onOrAfter方法代码示例

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


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

示例1: init

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
private void init(Version version, int minGram, int maxGram, boolean edgesOnly) {
  if (!version.onOrAfter(Version.LUCENE_4_4_0)) {
    throw new IllegalArgumentException("This class only works with Lucene 4.4+. To emulate the old (broken) behavior of NGramTokenizer, use Lucene43NGramTokenizer/Lucene43EdgeNGramTokenizer");
  }
  charUtils = version.onOrAfter(Version.LUCENE_4_4_0)
      ? CharacterUtils.getInstance(version)
      : CharacterUtils.getJava4Instance();
  if (minGram < 1) {
    throw new IllegalArgumentException("minGram must be greater than zero");
  }
  if (minGram > maxGram) {
    throw new IllegalArgumentException("minGram must not be greater than maxGram");
  }
  this.minGram = minGram;
  this.maxGram = maxGram;
  this.edgesOnly = edgesOnly;
  charBuffer = CharacterUtils.newCharacterBuffer(2 * maxGram + 1024); // 2 * maxGram in case all code points require 2 chars and + 1024 for buffering to not keep polling the Reader
  buffer = new int[charBuffer.getBuffer().length];
  // Make the term att large enough
  termAtt.resizeBuffer(2 * maxGram);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:NGramTokenizer.java

示例2: GermanAnalyzer

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/**
 * @deprecated {@link #GermanAnalyzer()}
 */
@Deprecated
public GermanAnalyzer(Version matchVersion) {
  this(matchVersion,
      matchVersion.onOrAfter(Version.LUCENE_3_1) ? DefaultSetHolder.DEFAULT_SET
          : DefaultSetHolder.DEFAULT_SET_30);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:GermanAnalyzer.java

示例3: DutchAnalyzer

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/**
 * @deprecated Use {@link #DutchAnalyzer(CharArraySet)}
 */
@Deprecated
public DutchAnalyzer(Version matchVersion, CharArraySet stopwords){
  // historically, this ctor never the stem dict!!!!!
  // so we populate it only for >= 3.6
  this(matchVersion, stopwords, CharArraySet.EMPTY_SET, 
      matchVersion.onOrAfter(Version.LUCENE_3_6) 
      ? DefaultSetHolder.DEFAULT_STEM_DICT 
      : CharArrayMap.<String>emptyMap());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:DutchAnalyzer.java

示例4: init

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
private void init(Version version, Side side, int minGram, int maxGram) {
  if (version == null) {
    throw new IllegalArgumentException("version must not be null");
  }

  if (side == null) {
    throw new IllegalArgumentException("sideLabel must be either front or back");
  }

  if (minGram < 1) {
    throw new IllegalArgumentException("minGram must be greater than zero");
  }

  if (minGram > maxGram) {
    throw new IllegalArgumentException("minGram must not be greater than maxGram");
  }

  if (version.onOrAfter(Version.LUCENE_4_4)) {
    if (side == Side.BACK) {
      throw new IllegalArgumentException("Side.BACK is not supported anymore as of Lucene 4.4");
    }
  } else {
    maxGram = Math.min(maxGram, 1024);
  }

  this.minGram = minGram;
  this.maxGram = maxGram;
  this.side = side;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:Lucene43EdgeNGramTokenizer.java

示例5: EdgeNGramTokenFilter

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/**
 * @deprecated For {@link Version#LUCENE_4_3_0} or below, use {@link Lucene43EdgeNGramTokenFilter}, otherwise use {@link #EdgeNGramTokenFilter(TokenStream, int, int)}
 */
@Deprecated
public EdgeNGramTokenFilter(Version version, TokenStream input, Side side, int minGram, int maxGram) {
  super(input);

  if (version.onOrAfter(Version.LUCENE_4_4) && side == Side.BACK) {
    throw new IllegalArgumentException("Side.BACK is not supported anymore as of Lucene 4.4, use ReverseStringFilter up-front and afterward");
  }

  if (side == null) {
    throw new IllegalArgumentException("sideLabel must be either front or back");
  }

  if (minGram < 1) {
    throw new IllegalArgumentException("minGram must be greater than zero");
  }

  if (minGram > maxGram) {
    throw new IllegalArgumentException("minGram must not be greater than maxGram");
  }

  this.version = version;
  this.charUtils = version.onOrAfter(Version.LUCENE_4_4)
      ? CharacterUtils.getInstance(version)
      : CharacterUtils.getJava4Instance();
  this.minGram = minGram;
  this.maxGram = maxGram;
  this.side = side;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:EdgeNGramTokenFilter.java

示例6: RussianAnalyzer

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/**
 * @deprecated Use {@link #RussianAnalyzer()}
 */
@Deprecated
public RussianAnalyzer(Version matchVersion) {
  this(matchVersion,
    matchVersion.onOrAfter(Version.LUCENE_3_1) ? DefaultSetHolder.DEFAULT_STOP_SET
        : DefaultSetHolder.DEFAULT_STOP_SET_30);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:RussianAnalyzer.java

示例7: init

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
private final void init(Version matchVersion) {
  if (matchVersion.onOrAfter(Version.LUCENE_4_7)) {
    this.scanner = new StandardTokenizerImpl(input);
  } else if (matchVersion.onOrAfter(Version.LUCENE_4_0)) {
    this.scanner = new StandardTokenizerImpl40(input);
  } else if (matchVersion.onOrAfter(Version.LUCENE_3_4)) {
    this.scanner = new StandardTokenizerImpl34(input);
  } else if (matchVersion.onOrAfter(Version.LUCENE_3_1)) {
    this.scanner = new StandardTokenizerImpl31(input);
  } else {
    this.scanner = new ClassicTokenizerImpl(input);
  }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:StandardTokenizer.java

示例8: getScannerFor

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
private StandardTokenizerInterface getScannerFor(Version matchVersion) {
  // best effort NPE if you dont call reset
  if (matchVersion.onOrAfter(Version.LUCENE_4_7)) {
    return new UAX29URLEmailTokenizerImpl(input);
  } else if (matchVersion.onOrAfter(Version.LUCENE_4_0)) {
    return new UAX29URLEmailTokenizerImpl40(input);
  } else if (matchVersion.onOrAfter(Version.LUCENE_3_6)) {
    return new UAX29URLEmailTokenizerImpl36(input);
  } else if (matchVersion.onOrAfter(Version.LUCENE_3_4)) {
    return new UAX29URLEmailTokenizerImpl34(input);
  } else {
    return new UAX29URLEmailTokenizerImpl31(input);
  }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:UAX29URLEmailTokenizer.java

示例9: ThaiWordFilter

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/**
 * @deprecated Use {@link #ThaiWordFilter(TokenStream)}
 */
@Deprecated
public ThaiWordFilter(Version matchVersion, TokenStream input) {
  super(matchVersion.onOrAfter(Version.LUCENE_3_1) ?
      input : new LowerCaseFilter(matchVersion, input));
  if (!DBBI_AVAILABLE)
    throw new UnsupportedOperationException("This JRE does not have support for Thai segmentation");
  handlePosIncr = matchVersion.onOrAfter(Version.LUCENE_3_1);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:ThaiWordFilter.java

示例10: FrenchAnalyzer

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/**
 * @deprecated Use {@link #FrenchAnalyzer()}
 */
@Deprecated
public FrenchAnalyzer(Version matchVersion) {
  this(matchVersion,
      matchVersion.onOrAfter(Version.LUCENE_3_1) ? DefaultSetHolder.DEFAULT_STOP_SET
          : DefaultSetHolder.DEFAULT_STOP_SET_30);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:FrenchAnalyzer.java

示例11: TrimFilter

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/**
 * Create a new {@link TrimFilter}.
 * @param version       the Lucene match version
 * @param in            the stream to consume
 * @param updateOffsets whether to update offsets
 * @deprecated Offset updates are not supported anymore as of Lucene 4.4.
 */
@Deprecated
public TrimFilter(Version version, TokenStream in, boolean updateOffsets) {
  super(in);
  if (updateOffsets && version.onOrAfter(Version.LUCENE_4_4)) {
    throw new IllegalArgumentException("updateOffsets=true is not supported anymore as of Lucene 4.4");
  }
  this.updateOffsets = updateOffsets;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:TrimFilter.java

示例12: WordDelimiterFilter

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/**
 * @deprecated Use {@link #WordDelimiterFilter(TokenStream, byte[], int, CharArraySet)}
 */
@Deprecated
public WordDelimiterFilter(Version matchVersion, TokenStream in, byte[] charTypeTable, int configurationFlags, CharArraySet protWords) {
  super(in);
  if (!matchVersion.onOrAfter(Version.LUCENE_4_8)) {
    throw new IllegalArgumentException("This class only works with Lucene 4.8+. To emulate the old (broken) behavior of WordDelimiterFilter, use Lucene47WordDelimiterFilter");
  }
  this.flags = configurationFlags;
  this.protWords = protWords;
  this.iterator = new WordDelimiterIterator(
      charTypeTable, has(SPLIT_ON_CASE_CHANGE), has(SPLIT_ON_NUMERICS), has(STEM_ENGLISH_POSSESSIVE));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:WordDelimiterFilter.java

示例13: init

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/** Initializes a query parser.  Called by the QueryParser constructor
 *  @param matchVersion  Lucene version to match. See <a href="QueryParser.html#version">here</a>.
 *  @param f  the default field for query terms.
 *  @param a   used to find terms in the query text.
 */
public void init(Version matchVersion, String f, Analyzer a) {
  init(f, a);
  if (matchVersion.onOrAfter(Version.LUCENE_3_1) == false) {
    setAutoGeneratePhraseQueries(true);
  }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:QueryParserBase.java

示例14: create

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public TokenStream create(TokenStream tokenStream) {
    final Version version = this.version == Version.LUCENE_4_3 ? Version.LUCENE_4_4 : this.version; // we supported it since 4.3
    if (version.onOrAfter(Version.LUCENE_4_3)) {
        return new NGramTokenFilter(tokenStream, minGram, maxGram);
    } else {
        return new Lucene43NGramTokenFilter(tokenStream, minGram, maxGram);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:NGramTokenFilterFactory.java

示例15: ThaiAnalyzer

import org.apache.lucene.util.Version; //导入方法依赖的package包/类
/**
 * @deprecated Use {@link #ThaiAnalyzer()}
 */
@Deprecated
public ThaiAnalyzer(Version matchVersion) {
  this(matchVersion, matchVersion.onOrAfter(Version.LUCENE_3_6) ? DefaultSetHolder.DEFAULT_STOP_SET : StopAnalyzer.ENGLISH_STOP_WORDS_SET);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ThaiAnalyzer.java


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