zemberek.morphology.analysis.WordAnalysis.isCorrect()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中zemberek.morphology.analysis.WordAnalysis.isCorrect()方法的一些代码示例,展示了WordAnalysis.isCorrect()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WordAnalysis.isCorrect()方法的具体详情如下:
包路径:zemberek.morphology.analysis.WordAnalysis
类名称:WordAnalysis
方法名:isCorrect

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;

相关文章