org.apache.lucene.analysis.Analyzer.getReuseStrategy()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.apache.lucene.analysis.Analyzer.getReuseStrategy()方法的一些代码示例,展示了Analyzer.getReuseStrategy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analyzer.getReuseStrategy()方法的具体详情如下:
包路径:org.apache.lucene.analysis.Analyzer
类名称:Analyzer
方法名:getReuseStrategy

Analyzer.getReuseStrategy介绍

[英]Returns the used ReuseStrategy.
[中]返回已使用的ReuseStragey。

代码示例

代码示例来源:origin: org.apache.lucene/lucene-core

@Override
 public void setReusableComponents(Analyzer analyzer, String fieldName,  TokenStreamComponents components) {
  if (analyzer == wrapper) {
   final Analyzer wrappedAnalyzer = wrapper.getWrappedAnalyzer(fieldName);
   wrappedAnalyzer.getReuseStrategy().setReusableComponents(wrappedAnalyzer, fieldName, components);
  } else {
   fallbackStrategy.setReusableComponents(analyzer, fieldName, components);
  }
 }
};

代码示例来源:origin: org.apache.lucene/lucene-core

@Override
public TokenStreamComponents getReusableComponents(Analyzer analyzer, String fieldName) {
 if (analyzer == wrapper) {
  final Analyzer wrappedAnalyzer = wrapper.getWrappedAnalyzer(fieldName);
  return wrappedAnalyzer.getReuseStrategy().getReusableComponents(wrappedAnalyzer, fieldName);
 } else {
  return fallbackStrategy.getReusableComponents(analyzer, fieldName);
 }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

PrefixWrappedAnalyzer(Analyzer delegate, int minChars, int maxChars) {
  super(delegate.getReuseStrategy());
  this.delegate = delegate;
  this.minChars = minChars;
  this.maxChars = maxChars;
}

代码示例来源:origin: org.apache.lucene/lucene-analyzers-common

/**
 * Build an analyzer that limits the maximum number of tokens per field.
 * @param delegate the analyzer to wrap
 * @param maxTokenCount max number of tokens to produce
 * @param consumeAllTokens whether all tokens from the delegate should be consumed even if maxTokenCount is reached.
 */
public LimitTokenCountAnalyzer(Analyzer delegate, int maxTokenCount, boolean consumeAllTokens) {
 super(delegate.getReuseStrategy());
 this.delegate = delegate;
 this.maxTokenCount = maxTokenCount;
 this.consumeAllTokens = consumeAllTokens;
}

代码示例来源:origin: org.elasticsearch/elasticsearch

PhraseWrappedAnalyzer(Analyzer delegate) {
  super(delegate.getReuseStrategy());
  this.delegate = delegate;
}

代码示例来源:origin: org.apache.lucene/lucene-analyzers-common

boolean outputUnigramsIfNoShingles,
 String fillerToken) {
super(delegate.getReuseStrategy());
this.delegate = delegate;

代码示例来源:origin: org.apache.lucene/lucene-analyzers-common

Collection<String> fields,
 int maxDocFreq) throws IOException {
super(delegate.getReuseStrategy());
this.delegate = delegate;

代码示例来源:origin: org.infinispan/infinispan-embedded-query

/**
 * Build an analyzer that limits the maximum number of tokens per field.
 * @param delegate the analyzer to wrap
 * @param maxTokenCount max number of tokens to produce
 * @param consumeAllTokens whether all tokens from the delegate should be consumed even if maxTokenCount is reached.
 */
public LimitTokenCountAnalyzer(Analyzer delegate, int maxTokenCount, boolean consumeAllTokens) {
 super(delegate.getReuseStrategy());
 this.delegate = delegate;
 this.maxTokenCount = maxTokenCount;
 this.consumeAllTokens = consumeAllTokens;
}

代码示例来源:origin: apache/servicemix-bundles

PrefixWrappedAnalyzer(Analyzer delegate, int minChars, int maxChars) {
  super(delegate.getReuseStrategy());
  this.delegate = delegate;
  this.minChars = minChars;
  this.maxChars = maxChars;
}

代码示例来源:origin: hibernate/hibernate-search

public HibernateSearchNormalizerWrapper(Analyzer delegate, String normalizerName) {
  super( delegate.getReuseStrategy() );
  this.delegate = delegate;
  this.normalizerName = normalizerName;
}

代码示例来源:origin: hibernate/hibernate-search

HibernateSearchNormalizerWrapper(String normalizerName, Analyzer delegate) {
  super( delegate.getReuseStrategy() );
  this.normalizerName = normalizerName;
  this.delegate = delegate;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

PrefixWrappedAnalyzer(Analyzer delegate, int minChars, int maxChars) {
  super(delegate.getReuseStrategy());
  this.delegate = delegate;
  this.minChars = minChars;
  this.maxChars = maxChars;
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
  public void setReusableComponents(Analyzer analyzer, String fieldName, TokenStreamComponents components) {
    if ( analyzer instanceof ConcurrentlyMutableAnalyzer ) {
      ConcurrentlyMutableAnalyzer cma = (ConcurrentlyMutableAnalyzer) analyzer;
      final Analyzer wrappedAnalyzer = cma.getWrappedAnalyzer( fieldName );
      wrappedAnalyzer.getReuseStrategy().setReusableComponents( analyzer, fieldName, components );
    }
    else {
      throw new AssertionFailure( "This ReuseStrategy should only be applied to a ConcurrentlyMutableAnalyzer " );
    }
  }
};

代码示例来源:origin: hibernate/hibernate-search

@Override
public TokenStreamComponents getReusableComponents(Analyzer analyzer, String fieldName) {
  if ( analyzer instanceof ConcurrentlyMutableAnalyzer ) {
    ConcurrentlyMutableAnalyzer cma = (ConcurrentlyMutableAnalyzer) analyzer;
    final Analyzer wrappedAnalyzer = cma.getWrappedAnalyzer( fieldName );
    return wrappedAnalyzer.getReuseStrategy().getReusableComponents( wrappedAnalyzer, fieldName );
  }
  else {
    throw new AssertionFailure( "This ReuseStrategy should only be applied to a ConcurrentlyMutableAnalyzer " );
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Override
  public void setReusableComponents(Analyzer analyzer, String fieldName, TokenStreamComponents components) {
    if ( analyzer instanceof ConcurrentlyMutableAnalyzer ) {
      ConcurrentlyMutableAnalyzer cma = (ConcurrentlyMutableAnalyzer) analyzer;
      final Analyzer wrappedAnalyzer = cma.getWrappedAnalyzer( fieldName );
      wrappedAnalyzer.getReuseStrategy().setReusableComponents( analyzer, fieldName, components );
    }
    else {
      throw new AssertionFailure( "This ReuseStrategy should only be applied to a ConcurrentlyMutableAnalyzer " );
    }
  }
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
public TokenStreamComponents getReusableComponents(Analyzer analyzer, String fieldName) {
 if (analyzer == wrapper) {
  final Analyzer wrappedAnalyzer = wrapper.getWrappedAnalyzer(fieldName);
  return wrappedAnalyzer.getReuseStrategy().getReusableComponents(wrappedAnalyzer, fieldName);
 } else {
  return fallbackStrategy.getReusableComponents(analyzer, fieldName);
 }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

@Override
public TokenStreamComponents getReusableComponents(Analyzer analyzer, String fieldName) {
 if (analyzer == wrapper) {
  final Analyzer wrappedAnalyzer = wrapper.getWrappedAnalyzer(fieldName);
  return wrappedAnalyzer.getReuseStrategy().getReusableComponents(wrappedAnalyzer, fieldName);
 } else {
  return fallbackStrategy.getReusableComponents(analyzer, fieldName);
 }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

@Override
 public void setReusableComponents(Analyzer analyzer, String fieldName,  TokenStreamComponents components) {
  if (analyzer == wrapper) {
   final Analyzer wrappedAnalyzer = wrapper.getWrappedAnalyzer(fieldName);
   wrappedAnalyzer.getReuseStrategy().setReusableComponents(wrappedAnalyzer, fieldName, components);
  } else {
   fallbackStrategy.setReusableComponents(analyzer, fieldName, components);
  }
 }
};

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
 public void setReusableComponents(Analyzer analyzer, String fieldName,  TokenStreamComponents components) {
  if (analyzer == wrapper) {
   final Analyzer wrappedAnalyzer = wrapper.getWrappedAnalyzer(fieldName);
   wrappedAnalyzer.getReuseStrategy().setReusableComponents(wrappedAnalyzer, fieldName, components);
  } else {
   fallbackStrategy.setReusableComponents(analyzer, fieldName, components);
  }
 }
};

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
public TokenStreamComponents getReusableComponents(Analyzer analyzer, String fieldName) {
  if ( analyzer instanceof ConcurrentlyMutableAnalyzer ) {
    ConcurrentlyMutableAnalyzer cma = (ConcurrentlyMutableAnalyzer) analyzer;
    final Analyzer wrappedAnalyzer = cma.getWrappedAnalyzer( fieldName );
    return wrappedAnalyzer.getReuseStrategy().getReusableComponents( wrappedAnalyzer, fieldName );
  }
  else {
    throw new AssertionFailure( "This ReuseStrategy should only be applied to a ConcurrentlyMutableAnalyzer " );
  }
}

相关文章