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


Java SetKeywordMarkerFilter类代码示例

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


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

示例1: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet(asSet("あり"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new JapaneseTokenizer(newAttributeFactory(), reader, null, true, JapaneseTokenizer.DEFAULT_MODE);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new JapaneseBaseFormFilter(sink));
    }
  };
  assertAnalyzesTo(a, "それはまだ実験段階にあります",
      new String[] { "それ", "は", "まだ", "実験", "段階", "に", "あり", "ます"  }
  );
}
 
开发者ID:europeana,项目名称:search,代码行数:15,代码来源:TestJapaneseBaseFormFilter.java

示例2: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet(asSet("コーヒー"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new JapaneseKatakanaStemFilter(sink));
    }
  };
  checkOneTerm(a, "コーヒー", "コーヒー");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestJapaneseKatakanaStemFilter.java

示例3: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("sängerinnen"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new GermanStemFilter(sink));
    }
  };
  checkOneTerm(a, "sängerinnen", "sängerinnen");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestGermanStemFilter.java

示例4: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("sängerinnen"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new GermanMinimalStemFilter(sink));
    }
  };
  checkOneTerm(a, "sängerinnen", "sängerinnen");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestGermanMinimalStemFilter.java

示例5: testWithKeywordAttribute

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testWithKeywordAttribute() throws IOException {
  CharArraySet set = new CharArraySet( 1, true);
  set.add("fischen");
  GermanStemFilter filter = new GermanStemFilter(
      new SetKeywordMarkerFilter(new LowerCaseTokenizer(new StringReader(
          "Fischen Trinken")), set));
  assertTokenStreamContents(filter, new String[] { "fischen", "trink" });
}
 
开发者ID:europeana,项目名称:search,代码行数:9,代码来源:TestGermanAnalyzer.java

示例6: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("sängerinnen"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new GermanLightStemFilter(sink));
    }
  };
  checkOneTerm(a, "sängerinnen", "sängerinnen");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestGermanLightStemFilter.java

示例7: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("sekretæren"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new NorwegianMinimalStemFilter(sink));
    }
  };
  checkOneTerm(a, "sekretæren", "sekretæren");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestNorwegianMinimalStemFilter.java

示例8: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("sekretæren"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new NorwegianLightStemFilter(sink));
    }
  };
  checkOneTerm(a, "sekretæren", "sekretæren");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestNorwegianLightStemFilter.java

示例9: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("edeltäjistään"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new FinnishLightStemFilter(sink));
    }
  };
  checkOneTerm(a, "edeltäjistään", "edeltäjistään");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestFinnishLightStemFilter.java

示例10: testWithKeywordAttribute

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testWithKeywordAttribute() throws IOException {
  CharArraySet set = new CharArraySet(1, true);
  set.add("ساهدهات");
  ArabicLetterTokenizer tokenStream  = new ArabicLetterTokenizer(TEST_VERSION_CURRENT, new StringReader("ساهدهات"));

  ArabicStemFilter filter = new ArabicStemFilter(new SetKeywordMarkerFilter(tokenStream, set));
  assertTokenStreamContents(filter, new String[]{"ساهدهات"});
}
 
开发者ID:europeana,项目名称:search,代码行数:9,代码来源:TestArabicStemFilter.java

示例11: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("энергии"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new RussianLightStemFilter(sink));
    }
  };
  checkOneTerm(a, "энергии", "энергии");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestRussianLightStemFilter.java

示例12: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("jaktkarlens"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new SwedishLightStemFilter(sink));
    }
  };
  checkOneTerm(a, "jaktkarlens", "jaktkarlens");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestSwedishLightStemFilter.java

示例13: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("babakocsi"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new HungarianLightStemFilter(sink));
    }
  };
  checkOneTerm(a, "babakocsi", "babakocsi");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestHungarianLightStemFilter.java

示例14: testWithKeywordAttribute

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testWithKeywordAttribute() throws IOException {
  CharArraySet set = new CharArraySet(1, true);
  set.add("строеве");
  MockTokenizer tokenStream = new MockTokenizer(new StringReader("строевете строеве"), MockTokenizer.WHITESPACE, false);

  BulgarianStemFilter filter = new BulgarianStemFilter(
      new SetKeywordMarkerFilter(tokenStream, set));
  assertTokenStreamContents(filter, new String[] { "строй", "строеве" });
}
 
开发者ID:europeana,项目名称:search,代码行数:10,代码来源:TestBulgarianStemmer.java

示例15: testKeyword

import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; //导入依赖的package包/类
public void testKeyword() throws IOException {
  final CharArraySet exclusionSet = new CharArraySet( asSet("elefantes"), false);
  Analyzer a = new Analyzer() {
    @Override
    protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
      Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
      TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
      return new TokenStreamComponents(source, new GalicianMinimalStemFilter(sink));
    }
  };
  checkOneTerm(a, "elefantes", "elefantes");
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:TestGalicianMinimalStemFilter.java


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