@Test public void test() throws IOException { String input = "4 Neden önemli?"; TurkishMorphology analyzer = TurkishMorphology.createWithDefaults(); RuleBasedDisambiguator disambiguator = new RuleBasedDisambiguator(analyzer, Rules.fromResources()); ResultSentence resultSentence = disambiguator.disambiguate(input); System.out.println(resultSentence.allIgnoredCount()); for (AmbiguityAnalysis a : resultSentence.results) { a.getForTrainingOutput().forEach(System.out::println); } }
public ResultSentence disambiguate(String sentence) { List<WordAnalysis> ambiguous = analyzer.analyzeSentence(sentence); ResultSentence s = new ResultSentence(sentence, ambiguous); s.makeDecisions(rules); return s; }
RuleBasedDisambiguator { public ResultSentence disambiguate(String sentence) { List<WordAnalysis> ambiguous = analyzer.analyzeSentence(sentence); ResultSentence s = new ResultSentence(sentence, ambiguous); s.makeDecisions(rules); return s; } }
RuleBasedDisambiguator { public ResultSentence disambiguate(String sentence) { List<WordAnalysis> ambiguous = analyzer.analyzeSentence(sentence); ResultSentence s = new ResultSentence(sentence, ambiguous); s.makeDecisions(rules); return s; } RuleBasedDisambiguator(TurkishMorphology analyzer, Rules rules); }
RuleBasedDisambiguator { public ResultSentence disambiguate(String sentence) { List<WordAnalysis> ambiguous = analyzer.analyzeSentence(sentence); ResultSentence s = new ResultSentence(sentence, ambiguous); s.makeDecisions(rules); return s; } RuleBasedDisambiguator(TurkishMorphology analyzer, Rules rules); ResultSentence disambiguate(String sentence); }
RuleBasedDisambiguator { public ResultSentence disambiguate(String sentence) { List<WordAnalysis> ambiguous = analyzer.analyzeSentence(sentence); ResultSentence s = new ResultSentence(sentence, ambiguous); s.makeDecisions(rules); return s; } RuleBasedDisambiguator(TurkishMorphology analyzer, Rules rules); ResultSentence disambiguate(String sentence);  }