@Test public void testGeneration5() { TurkishMorphotactics mo = getMorphotactics("yapmak"); WordGenerator wordGenerator = new WordGenerator(mo); List<String> morphemes = Lists.newArrayList("Verb", "Opt", "A1pl"); DictionaryItem item = mo.getRootLexicon().getItemById("yapmak_Verb"); List<Result> results = wordGenerator.generate( item, TurkishMorphotactics.getMorphemes(morphemes) ); Assert.assertTrue(results.size() > 0); Assert.assertEquals("yapalım", results.get(0).surface); }
public List<Result> generate(String stem, List<String> morphemeIds) { List<Morpheme> morphemes = new ArrayList<>(); for (String morphemeId : morphemeIds) { Morpheme morpheme = TurkishMorphotactics.getMorpheme(morphemeId); morphemes.add(morpheme); } List<StemTransition> candidates = stemTransitions.getPrefixMatches(stem, false); return generate(stem, candidates, morphemes); }
WordGenerator { public List<Result> generate(String stem, List<String> morphemeIds) { List<Morpheme> morphemes = new ArrayList<>(); for (String morphemeId : morphemeIds) { Morpheme morpheme = TurkishMorphotactics.getMorpheme(morphemeId); morphemes.add(morpheme); } List<StemTransition> candidates = stemTransitions.getPrefixMatches(stem, false); return generate(stem, candidates, morphemes); } }
WordGenerator { public List<Result> generate(String stem, List<String> morphemeIds) { List<Morpheme> morphemes = new ArrayList<>(); for (String morphemeId : morphemeIds) { Morpheme morpheme = TurkishMorphotactics.getMorpheme(morphemeId); morphemes.add(morpheme); } List<StemTransition> candidates = stemTransitions.getPrefixMatches(stem, false); return generate(stem, candidates, morphemes); } WordGenerator(TurkishMorphotactics morphotactics); }
WordGenerator { public List<Result> generate(String stem, List<String> morphemeIds) { List<Morpheme> morphemes = new ArrayList<>(); for (String morphemeId : morphemeIds) { Morpheme morpheme = TurkishMorphotactics.getMorpheme(morphemeId); morphemes.add(morpheme); } List<StemTransition> candidates = stemTransitions.getPrefixMatches(stem, false); return generate(stem, candidates, morphemes); } WordGenerator(TurkishMorphotactics morphotactics); static WordGenerator forDebug(TurkishMorphotactics morphotactics); AnalysisDebugData getDebugData(); List<Result> generate(String stem, List<String> morphemeIds); List<Result> generate(DictionaryItem item, List<Morpheme> morphemes); List<Result> generate(DictionaryItem item, Morpheme... morphemes); List<Result> generate(DictionaryItem item, String... morphemeIds); }
WordGenerator { public List<Result> generate(String stem, List<String> morphemeIds) { List<Morpheme> morphemes = new ArrayList<>(); for (String morphemeId : morphemeIds) { Morpheme morpheme = TurkishMorphotactics.getMorpheme(morphemeId); morphemes.add(morpheme); } List<StemTransition> candidates = stemTransitions.getPrefixMatches(stem, false); return generate(stem, candidates, morphemes); } WordGenerator(TurkishMorphotactics morphotactics); static WordGenerator forDebug(TurkishMorphotactics morphotactics); AnalysisDebugData getDebugData(); List<Result> generate(String stem, List<String> morphemeIds); List<Result> generate(DictionaryItem item, List<Morpheme> morphemes); List<Result> generate(DictionaryItem item, Morpheme... morphemes); List<Result> generate(DictionaryItem item, String... morphemeIds);  }