@Test public void checkVerb1() { TurkishMorphology morphology = TurkishMorphology.builder().setLexicon("okumak").build(); List<String> endings = Lists.newArrayList("dum"); StemEndingGraph graph = new StemEndingGraph(morphology, endings); TurkishSpellChecker spellChecker = new TurkishSpellChecker(morphology, graph.stemGraph); Assert.assertTrue(spellChecker.check("okudum")); }
public boolean check(String input) { WordAnalysis analyses = morphology.analyze(input); WordAnalysisSurfaceFormatter.CaseType caseType = formatter.guessCase(input); for (SingleAnalysis analysis : analyses) { if (analysis.isUnknown()) { continue; } if (analysisPredicate != null && !analysisPredicate.test(analysis)) { continue; } String apostrophe = getApostrophe(input); if (formatter.canBeFormatted(analysis, caseType)) { String formatted = formatter.formatToCase(analysis, caseType, apostrophe); if (input.equals(formatted)) { return true; } } } return false; }
TurkishSpellChecker { public boolean check(String input) { WordAnalysis analyses = morphology.analyze(input); WordAnalysisSurfaceFormatter.CaseType caseType = formatter.guessCase(input); for (SingleAnalysis analysis : analyses) { if (analysis.isUnknown()) { continue; } if (analysisPredicate != null && !analysisPredicate.test(analysis)) { continue; } String apostrophe = getApostrophe(input); if (formatter.canBeFormatted(analysis, caseType)) { String formatted = formatter.formatToCase(analysis, caseType, apostrophe); if (input.equals(formatted)) { return true; } } } return false; } }
TurkishSpellChecker { public boolean check(String input) { WordAnalysis analyses = morphology.analyze(input); WordAnalysisSurfaceFormatter.CaseType caseType = formatter.guessCase(input); for (SingleAnalysis analysis : analyses) { if (analysis.isUnknown()) { continue; } if (analysisPredicate != null && !analysisPredicate.test(analysis)) { continue; } String apostrophe = getApostrophe(input); if (formatter.canBeFormatted(analysis, caseType)) { String formatted = formatter.formatToCase(analysis, caseType, apostrophe); if (input.equals(formatted)) { return true; } } } return false; } TurkishSpellChecker(TurkishMorphology morphology);  TurkishSpellChecker(TurkishMorphology morphology, CharacterGraph graph);  TurkishSpellChecker(
      TurkishMorphology morphology,
      CharacterGraphDecoder decoder,
      CharMatcher matcher); }
TurkishSpellChecker { public boolean check(String input) { WordAnalysis analyses = morphology.analyze(input); WordAnalysisSurfaceFormatter.CaseType caseType = formatter.guessCase(input); for (SingleAnalysis analysis : analyses) { if (analysis.isUnknown()) { continue; } if (analysisPredicate != null && !analysisPredicate.test(analysis)) { continue; } String apostrophe = getApostrophe(input); if (formatter.canBeFormatted(analysis, caseType)) { String formatted = formatter.formatToCase(analysis, caseType, apostrophe); if (input.equals(formatted)) { return true; } } } return false; } TurkishSpellChecker(TurkishMorphology morphology);  TurkishSpellChecker(TurkishMorphology morphology, CharacterGraph graph);  TurkishSpellChecker(
      TurkishMorphology morphology,
      CharacterGraphDecoder decoder,
      CharMatcher matcher); NgramLanguageModel getUnigramLanguageModel(); void setAnalysisPredicate(Predicate<SingleAnalysis> analysisPredicate); static List<String> tokenizeForSpelling(String sentence); boolean check(String input); List<String> suggestForWord(String word, NgramLanguageModel lm); List<String> suggestForWord(
      String word,
      String leftContext,
      String rightContext,
      NgramLanguageModel lm); List<String> suggestForWord(String word); CharacterGraphDecoder getDecoder(); List<String> rankWithUnigramProbability(List<String> strings, NgramLanguageModel lm); }
TurkishSpellChecker { public boolean check(String input) { WordAnalysis analyses = morphology.analyze(input); WordAnalysisSurfaceFormatter.CaseType caseType = formatter.guessCase(input); for (SingleAnalysis analysis : analyses) { if (analysis.isUnknown()) { continue; } if (analysisPredicate != null && !analysisPredicate.test(analysis)) { continue; } String apostrophe = getApostrophe(input); if (formatter.canBeFormatted(analysis, caseType)) { String formatted = formatter.formatToCase(analysis, caseType, apostrophe); if (input.equals(formatted)) { return true; } } } return false; } TurkishSpellChecker(TurkishMorphology morphology);  TurkishSpellChecker(TurkishMorphology morphology, CharacterGraph graph);  TurkishSpellChecker(
      TurkishMorphology morphology,
      CharacterGraphDecoder decoder,
      CharMatcher matcher); NgramLanguageModel getUnigramLanguageModel(); void setAnalysisPredicate(Predicate<SingleAnalysis> analysisPredicate); static List<String> tokenizeForSpelling(String sentence); boolean check(String input); List<String> suggestForWord(String word, NgramLanguageModel lm); List<String> suggestForWord(
      String word,
      String leftContext,
      String rightContext,
      NgramLanguageModel lm); List<String> suggestForWord(String word); CharacterGraphDecoder getDecoder(); List<String> rankWithUnigramProbability(List<String> strings, NgramLanguageModel lm);  }