dictvaluetest.java
来自「这是关于中文分词的有关程序」· Java 代码 · 共 40 行
JAVA
40 行
/*
* Created on 2005-12-29
* author 谢骋超
*
*/
package cn.edu.zju.dartsplitter.data;
import junit.framework.TestCase;
import org.apache.log4j.Logger;
import cn.edu.zju.dartsplitter.data.DictValue;
public class DictValueTest extends TestCase{
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(DictValueTest.class);
public void testGetNextValue(){
DictValue dictValue=new DictValue("感冒");
dictValue.setCurPos(0);
dictValue.setUseCount(0);
//dictValue.setValue("感觉障碍检测");
printDictValue(dictValue);
dictValue.setCurPos(2);
printDictValue(dictValue);
}
private void printDictValue(DictValue dictValue) {
String nextVal;
do{
nextVal=dictValue.nextValue();
logger.debug("next value is "+nextVal+" \n");
}
while(null!=nextVal);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?