Java 类org.apache.lucene.analysis.ja.util.UnknownDictionaryWriter 实例源码

项目:search    文件:UnknownDictionaryTest.java   
@Test
public void testPut() {
  UnknownDictionaryWriter unkDic = new UnknownDictionaryWriter(10 * 1024 * 1024);
  try{
    unkDic.put(CSVUtil.parse("KANJI,1285,11426,名詞,一般,*,*,*,*,*,*,*"));
    fail();
  } catch(Exception e){

  }

  String entry1 = "ALPHA,1285,1285,13398,名詞,一般,*,*,*,*,*,*,*";
  String entry2 = "HIRAGANA,1285,1285,13069,名詞,一般,*,*,*,*,*,*,*";
  String entry3 = "KANJI,1285,1285,11426,名詞,一般,*,*,*,*,*,*,*";

  unkDic.putCharacterCategory(0, "ALPHA");
  unkDic.putCharacterCategory(1, "HIRAGANA");
  unkDic.putCharacterCategory(2, "KANJI");

  unkDic.put(CSVUtil.parse(entry1));
  unkDic.put(CSVUtil.parse(entry2));
  unkDic.put(CSVUtil.parse(entry3));
}
项目:NYBC    文件:UnknownDictionaryTest.java   
@Test
public void testPut() {
  UnknownDictionaryWriter unkDic = new UnknownDictionaryWriter(10 * 1024 * 1024);
  try{
    unkDic.put(CSVUtil.parse("KANJI,1285,11426,名詞,一般,*,*,*,*,*,*,*"));
    fail();
  } catch(Exception e){

  }

  String entry1 = "ALPHA,1285,1285,13398,名詞,一般,*,*,*,*,*,*,*";
  String entry2 = "HIRAGANA,1285,1285,13069,名詞,一般,*,*,*,*,*,*,*";
  String entry3 = "KANJI,1285,1285,11426,名詞,一般,*,*,*,*,*,*,*";

  unkDic.putCharacterCategory(0, "ALPHA");
  unkDic.putCharacterCategory(1, "HIRAGANA");
  unkDic.putCharacterCategory(2, "KANJI");

  unkDic.put(CSVUtil.parse(entry1));
  unkDic.put(CSVUtil.parse(entry2));
  unkDic.put(CSVUtil.parse(entry3));
}
项目:Maskana-Gestor-de-Conocimiento    文件:UnknownDictionaryTest.java   
@Test
public void testPut() {
  UnknownDictionaryWriter unkDic = new UnknownDictionaryWriter(10 * 1024 * 1024);
  try{
    unkDic.put(CSVUtil.parse("KANJI,1285,11426,名詞,一般,*,*,*,*,*,*,*"));
    fail();
  } catch(Exception e){

  }

  String entry1 = "ALPHA,1285,1285,13398,名詞,一般,*,*,*,*,*,*,*";
  String entry2 = "HIRAGANA,1285,1285,13069,名詞,一般,*,*,*,*,*,*,*";
  String entry3 = "KANJI,1285,1285,11426,名詞,一般,*,*,*,*,*,*,*";

  unkDic.putCharacterCategory(0, "ALPHA");
  unkDic.putCharacterCategory(1, "HIRAGANA");
  unkDic.putCharacterCategory(2, "KANJI");

  unkDic.put(CSVUtil.parse(entry1));
  unkDic.put(CSVUtil.parse(entry2));
  unkDic.put(CSVUtil.parse(entry3));
}