### Question:
CharacterGraphDecoder { public List<ScoredItem<String>> getSuggestionsWithScores(String input) { Decoder decoder = new Decoder(); return getMatches(input, decoder); } CharacterGraphDecoder(float maxPenalty);  CharacterGraphDecoder();  CharacterGraphDecoder(CharacterGraph graph);  CharacterGraphDecoder(float maxPenalty, Map<Character, String> nearKeyMap); CharacterGraph getGraph(); void addWord(String word); void addWords(String... words); void addWords(List<String> vocabulary); List<ScoredItem<String>> getSuggestionsWithScores(String input); List<ScoredItem<String>> getSuggestionsWithScores(String input, CharMatcher matcher); FloatValueMap<String> decode(String input); List<String> getSuggestions(String input); List<String> getSuggestions(String input, CharMatcher matcher); List<String> getSuggestionsSorted(String input); static final Map<Character, String> TURKISH_FQ_NEAR_KEY_MAP; static final Map<Character, String> TURKISH_Q_NEAR_KEY_MAP; static final DiacriticsIgnoringMatcher DIACRITICS_IGNORING_MATCHER; final float maxPenalty; final boolean checkNearKeySubstitution; public Map<Character, String> nearKeyMap; }### Answer:
@Test public void stemEndingTest2() { TurkishMorphology morphology = TurkishMorphology.builder() .setLexicon("üzmek", "yüz", "güz").build(); List<String> endings = Lists.newArrayList("düm"); StemEndingGraph graph = new StemEndingGraph(morphology, endings); CharacterGraphDecoder spellChecker = new CharacterGraphDecoder(graph.stemGraph); List<ScoredItem<String>> res = spellChecker.getSuggestionsWithScores("yüzdüm"); Assert.assertEquals(3, res.size()); assertContainsAll(res, "yüzdüm", "üzdüm", "güzdüm"); }
@Test public void stemEndingTest3() { TurkishMorphology morphology = TurkishMorphology.builder().setLexicon("o", "ol", "ola") .build(); List<String> endings = Lists.newArrayList("arak", "acak"); StemEndingGraph graph = new StemEndingGraph(morphology, endings); CharacterGraphDecoder spellChecker = new CharacterGraphDecoder(graph.stemGraph); List<ScoredItem<String>> res = spellChecker.getSuggestionsWithScores("olarak"); assertContainsAll(res, "olarak", "olacak", "olaarak"); }
@Test public void stemEndingTest() { TurkishMorphology morphology = TurkishMorphology.builder() .setLexicon("Türkiye", "Bayram").build(); List<String> endings = Lists.newArrayList("ında", "de"); StemEndingGraph graph = new StemEndingGraph(morphology, endings); CharacterGraphDecoder spellChecker = new CharacterGraphDecoder(graph.stemGraph); List<ScoredItem<String>> res = spellChecker.getSuggestionsWithScores("türkiyede"); assertContainsAll(res, "türkiyede"); }