Java语言检测
实际上,我正在使用java语言检测来检测文本语言,我有一个错误:Java语言检测,java,language-translation,Java,Language Translation,实际上,我正在使用java语言检测来检测文本语言,我有一个错误: Exception in thread "main" java.lang.IllegalAccessError: tried to access field com.cybozu.labs.langdetect.util.LangProfile.name from class com.cybozu.labs.langdetect.DetectorFactory 这是我的密码: public static String l
Exception in thread "main" java.lang.IllegalAccessError: tried to access field com.cybozu.labs.langdetect.util.LangProfile.name from class com.cybozu.labs.langdetect.DetectorFactory
这是我的密码:
public static String landDetect(String text) throws LangDetectException {
String profileDirectory ="D:\\Spam Detection PFE 2016\\profiles";
try {
DetectorFactory.loadProfile(profileDirectory);
} catch (LangDetectException ex) {
Logger.getLogger(attribute_functions.class.getName()).log(Level.SEVERE, null, ex);
}
Detector detector = DetectorFactory.create();
detector.append(text);
return(detector.detect());
}
也许您应该尝试访问库,而不是寻求stackoverflow的支持,因为您的代码似乎与相同。LangProfile中的
name
字段是私有的吗?它似乎试图访问该字段,但它无法访问;而不是一个。谢谢你