Java 类org.apache.lucene.analysis.charfilter.MappingCharFilterFactory 实例源码

项目:search    文件:MultiTermTest.java   
@Test
public void testQueryCopiedToMulti() {
  SchemaField field = h.getCore().getLatestSchema().getField("content_charfilter");
  Analyzer analyzer = ((TextField)field.getType()).getMultiTermAnalyzer();
  assertTrue(analyzer instanceof TokenizerChain);
  assertTrue(((TokenizerChain) analyzer).getTokenizerFactory() instanceof KeywordTokenizerFactory);
  TokenizerChain tc = (TokenizerChain) analyzer;
  for (TokenFilterFactory factory : tc.getTokenFilterFactories()) {
    assertTrue(factory instanceof LowerCaseFilterFactory);
  }

  assertTrue(tc.getCharFilterFactories().length == 1);
  assertTrue(tc.getCharFilterFactories()[0] instanceof MappingCharFilterFactory);
}
项目:NYBC    文件:MultiTermTest.java   
@Test
public void testQueryCopiedToMulti() {
  SchemaField field = h.getCore().getSchema().getField("content_charfilter");
  Analyzer analyzer = ((TextField)field.getType()).getMultiTermAnalyzer();
  assertTrue(analyzer instanceof TokenizerChain);
  assertTrue(((TokenizerChain) analyzer).getTokenizerFactory() instanceof KeywordTokenizerFactory);
  TokenizerChain tc = (TokenizerChain) analyzer;
  for (TokenFilterFactory factory : tc.getTokenFilterFactories()) {
    assertTrue(factory instanceof LowerCaseFilterFactory);
  }

  assertTrue(tc.getCharFilterFactories().length == 1);
  assertTrue(tc.getCharFilterFactories()[0] instanceof MappingCharFilterFactory);
}
项目:search-core    文件:MultiTermTest.java   
@Test
public void testQueryCopiedToMulti() {
  SchemaField field = h.getCore().getSchema().getField("content_charfilter");
  Analyzer analyzer = ((TextField)field.getType()).getMultiTermAnalyzer();
  assertTrue(analyzer instanceof TokenizerChain);
  assertTrue(((TokenizerChain) analyzer).getTokenizerFactory() instanceof KeywordTokenizerFactory);
  TokenizerChain tc = (TokenizerChain) analyzer;
  for (TokenFilterFactory factory : tc.getTokenFilterFactories()) {
    assertTrue(factory instanceof LowerCaseFilterFactory);
  }

  assertTrue(tc.getCharFilterFactories().length == 1);
  assertTrue(tc.getCharFilterFactories()[0] instanceof MappingCharFilterFactory);
}
项目:lucene-tokenizers-for-multilang    文件:CJKBigramFilterTest.java   
@BeforeClass
public static void setUp() throws Exception {
    Map<String, String> map = new HashMap<String, String>();
    map.put("mapping", "mapping.txt");
    charFilterFactory = new MappingCharFilterFactory(map);
    charFilterFactory.inform(new FilesystemResourceLoader(new File(
            "src/test/resources/cjkbigramfilter")));
    tokenizerFactory = new CJKTokenizerFactory(new HashMap<String, String>());
    map = new HashMap<String, String>();
    map.put("outputUnigrams", "true");
    tokenFilterFactory = new CJKBigramFilterFactory(map);
}