Java 类org.apache.lucene.analysis.th.ThaiWordFilter 实例源码

项目:search    文件:TestThaiWordFilterFactory.java   
/**
 * Ensure the filter actually decomposes text.
 */
public void testWordBreak() throws Exception {
  assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
  Reader reader = new StringReader("การที่ได้ต้องแสดงว่างานดี");
  TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
  stream = tokenFilterFactory("ThaiWord").create(stream);
  assertTokenStreamContents(stream, new String[] {"การ", "ที่", "ได้",
      "ต้อง", "แสดง", "ว่า", "งาน", "ดี"});
}
项目:search    文件:TestThaiWordFilterFactory.java   
/** Test that bogus arguments result in exception */
public void testBogusArguments() throws Exception {
  assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
  try {
    tokenFilterFactory("ThaiWord", "bogusArg", "bogusValue");
    fail();
  } catch (IllegalArgumentException expected) {
    assertTrue(expected.getMessage().contains("Unknown parameters"));
  }
}
项目:NYBC    文件:TestThaiWordFilterFactory.java   
/**
 * Ensure the filter actually decomposes text.
 */
public void testWordBreak() throws Exception {
  assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
  Reader reader = new StringReader("การที่ได้ต้องแสดงว่างานดี");
  Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
  ThaiWordFilterFactory factory = new ThaiWordFilterFactory();
  factory.setLuceneMatchVersion(TEST_VERSION_CURRENT);
  Map<String, String> args = Collections.emptyMap();
  factory.init(args);
  TokenStream stream = factory.create(tokenizer);
  assertTokenStreamContents(stream, new String[] {"การ", "ที่", "ได้",
      "ต้อง", "แสดง", "ว่า", "งาน", "ดี"});
}
项目:Maskana-Gestor-de-Conocimiento    文件:TestThaiWordFilterFactory.java   
/**
 * Ensure the filter actually decomposes text.
 */
public void testWordBreak() throws Exception {
  assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
  Reader reader = new StringReader("การที่ได้ต้องแสดงว่างานดี");
  TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
  stream = tokenFilterFactory("ThaiWord").create(stream);
  assertTokenStreamContents(stream, new String[] {"การ", "ที่", "ได้",
      "ต้อง", "แสดง", "ว่า", "งาน", "ดี"});
}
项目:Maskana-Gestor-de-Conocimiento    文件:TestThaiWordFilterFactory.java   
/** Test that bogus arguments result in exception */
public void testBogusArguments() throws Exception {
  assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
  try {
    tokenFilterFactory("ThaiWord", "bogusArg", "bogusValue");
    fail();
  } catch (IllegalArgumentException expected) {
    assertTrue(expected.getMessage().contains("Unknown parameters"));
  }
}
项目:lams    文件:ThaiWordFilterFactory.java   
@Override
public ThaiWordFilter create(TokenStream input) {
  return new ThaiWordFilter(input);
}
项目:search    文件:ThaiWordFilterFactory.java   
@Override
public ThaiWordFilter create(TokenStream input) {
  return new ThaiWordFilter(input);
}
项目:NYBC    文件:ThaiWordFilterFactory.java   
@Override
public ThaiWordFilter create(TokenStream input) {
  assureMatchVersion();
  return new ThaiWordFilter(luceneMatchVersion, input);
}
项目:read-open-source-code    文件:ThaiWordFilterFactory.java   
@Override
public ThaiWordFilter create(TokenStream input) {
  return new ThaiWordFilter(luceneMatchVersion, input);
}
项目:read-open-source-code    文件:ThaiWordFilterFactory.java   
@Override
public ThaiWordFilter create(TokenStream input) {
  return new ThaiWordFilter(luceneMatchVersion, input);
}
项目:read-open-source-code    文件:ThaiWordFilterFactory.java   
@Override
public ThaiWordFilter create(TokenStream input) {
  return new ThaiWordFilter(input);
}
项目:Maskana-Gestor-de-Conocimiento    文件:ThaiWordFilterFactory.java   
@Override
public ThaiWordFilter create(TokenStream input) {
  return new ThaiWordFilter(luceneMatchVersion, input);
}