问题描述
- 请教一个中文词性标注的问题,请大牛指点
- 报错:没有为类型 WordAlert 定义方法 isEnglish(String)
源码如下:
public static List recognition(List words int offe) {
List terms = new ArrayList(words.size());
int tempOffe = 0;
String[] params = null;
for (String word : words) {// 获得词性 , 先从系统辞典,再从用户自定义辞典 AnsjItem ansjItem = DATDictionary.getItem(word); TermNatures tn = null; if ((params = UserDefineLibrary.getParams(word)) != null) { tn = new TermNatures(new TermNature(params[0] 1)); } else if (ansjItem.termNatures != TermNatures.NULL) { tn = ansjItem.termNatures; } else if(WordAlert.isEnglish(word)){ tn = TermNatures.EN ; } else if(WordAlert.isNumber(word)){ tn = TermNatures.M ; } else{ tn = TermNatures.NULL ; } terms.add(new Term(word offe + tempOffe tn)); tempOffe += word.length(); } new NatureRecognition(terms).recognition(); return terms; }
时间: 2024-09-17 03:40:35