本文整理了Java中zemberek.morphology.analysis.WordAnalysis.isCorrect()
方法的一些代码示例,展示了WordAnalysis.isCorrect()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WordAnalysis.isCorrect()
方法的具体详情如下:
包路径:zemberek.morphology.analysis.WordAnalysis
类名称:WordAnalysis
方法名:isCorrect
暂无
代码示例来源:origin: ahmetaa/zemberek-nlp
private static void filterVocab(Path vocabFile, Path outFile) throws IOException {
List<String> words = Files.readAllLines(vocabFile, StandardCharsets.UTF_8);
TurkishMorphology morphology = TurkishMorphology.createWithDefaults();
List<String> result = new ArrayList<>();
for (String word : words) {
WordAnalysis analysis = morphology.analyze(word);
if (!analysis.isCorrect()) {
Log.warn("Cannot analyze %s", word);
continue;
}
result.add(word);
}
Files.write(outFile, result, StandardCharsets.UTF_8);
}
代码示例来源:origin: ahmetaa/zemberek-nlp
private static boolean isCorrectAndContainsNoProper(WordAnalysis analysis) {
if (!analysis.isCorrect()) {
return false;
}
for (SingleAnalysis s : analysis) {
if (s.getDictionaryItem().secondaryPos != SecondaryPos.ProperNoun &&
s.getDictionaryItem().secondaryPos != SecondaryPos.Abbreviation) {
return true;
}
}
return false;
}
代码示例来源:origin: ahmetaa/zemberek-nlp
for (String word : words) {
WordAnalysis analysis = morphology.analyze(word);
if (!analysis.isCorrect()) {
Log.warn("Cannot analyze %s", word);
continue;
代码示例来源:origin: ahmetaa/zemberek-nlp
for (String word : words) {
WordAnalysis analysis = morphology.analyze(word);
if (!analysis.isCorrect()) {
Log.warn("Cannot analyze %s", word);
continue;
代码示例来源:origin: ahmetaa/zemberek-nlp
if (candidates.isEmpty() || morphology.analyze(current).isCorrect()) {
candidates.add(current);
代码示例来源:origin: ahmetaa/zemberek-nlp
for (String word : words) {
WordAnalysis a = morphology.analyze(word);
if (a.isCorrect()) {
accepted++;
代码示例来源:origin: ahmetaa/zemberek-nlp
if (!a.isCorrect()) {
break;
代码示例来源:origin: ahmetaa/zemberek-nlp
if ((tail.equals("de") || tail.equals("da")) && morphology.analyze(head).isCorrect()) {
continue;
内容来源于网络,如有侵权,请联系作者删除!