@Test public void testShouldRecognizePuncRoots() { { final List<? extends Root> rootsForPartialInput = findRootsForPartialInput(".", "."); assertThat(rootsForPartialInput, hasSize(1)); assertThat(rootsForPartialInput.get(0).getSequence().getUnderlyingString(), equalTo(".")); assertThat(rootsForPartialInput.get(0).getLexeme().getLemma(), equalTo(".")); assertThat(rootsForPartialInput.get(0).getLexeme().getLemmaRoot(), equalTo(".")); } { final List<? extends Root> rootsForPartialInput = findRootsForPartialInput("..................", ".................."); assertThat(rootsForPartialInput, hasSize(1)); assertThat(rootsForPartialInput.get(0).getSequence().getUnderlyingString(), equalTo("..................")); assertThat(rootsForPartialInput.get(0).getLexeme().getLemma(), equalTo("..................")); assertThat(rootsForPartialInput.get(0).getLexeme().getLemmaRoot(), equalTo("..................")); } { final List<? extends Root> rootsForPartialInput = findRootsForPartialInput("‿﹎﹏»”>", "‿﹎﹏»”>"); assertThat(rootsForPartialInput, hasSize(1)); assertThat(rootsForPartialInput.get(0).getSequence().getUnderlyingString(), equalTo("‿﹎﹏»”>")); assertThat(rootsForPartialInput.get(0).getLexeme().getLemma(), equalTo("‿﹎﹏»”>")); assertThat(rootsForPartialInput.get(0).getLexeme().getLemmaRoot(), equalTo("‿﹎﹏»”>")); } { final List<? extends Root> rootsForPartialInput = findRootsForPartialInput("„⁅{﹃｟&_!§՜։܀܍෴៘‱⁂〽﹌＠｡；゠﹣︾҂©°", "„⁅{﹃｟&_!§՜։܀܍෴៘‱⁂〽﹌＠｡；゠﹣︾҂©°"); assertThat(rootsForPartialInput, hasSize(1)); assertThat(rootsForPartialInput.get(0).getSequence().getUnderlyingString(), equalTo("„⁅{﹃｟&_!§՜։܀܍෴៘‱⁂〽﹌＠｡；゠﹣︾҂©°")); assertThat(rootsForPartialInput.get(0).getLexeme().getLemma(), equalTo("„⁅{﹃｟&_!§՜։܀܍෴៘‱⁂〽﹌＠｡；゠﹣︾҂©°")); assertThat(rootsForPartialInput.get(0).getLexeme().getLemmaRoot(), equalTo("„⁅{﹃｟&_!§՜։܀܍෴៘‱⁂〽﹌＠｡；゠﹣︾҂©°")); } }
@Override public List<ImmutableRoot> findRootsForPartialInput(TurkishSequence partialInput, TurkishSequence input) { final ImmutableLexeme lexeme = new ImmutableLexeme(partialInput.getUnderlyingString(), input.getUnderlyingString(), PrimaryPos.Punctuation, null, null); return Arrays.asList(new ImmutableRoot(partialInput, lexeme, null, null)); }
PuncRootFinder implements RootFinder { @Override public List<ImmutableRoot> findRootsForPartialInput(TurkishSequence partialInput, TurkishSequence input) { final ImmutableLexeme lexeme = new ImmutableLexeme(partialInput.getUnderlyingString(), input.getUnderlyingString(), PrimaryPos.Punctuation, null, null); return Arrays.asList(new ImmutableRoot(partialInput, lexeme, null, null)); } }
PuncRootFinder implements RootFinder { @Override public List<ImmutableRoot> findRootsForPartialInput(TurkishSequence partialInput, TurkishSequence input) { final ImmutableLexeme lexeme = new ImmutableLexeme(partialInput.getUnderlyingString(), input.getUnderlyingString(), PrimaryPos.Punctuation, null, null); return Arrays.asList(new ImmutableRoot(partialInput, lexeme, null, null)); }  }
PuncRootFinder implements RootFinder { @Override public List<ImmutableRoot> findRootsForPartialInput(TurkishSequence partialInput, TurkishSequence input) { final ImmutableLexeme lexeme = new ImmutableLexeme(partialInput.getUnderlyingString(), input.getUnderlyingString(), PrimaryPos.Punctuation, null, null); return Arrays.asList(new ImmutableRoot(partialInput, lexeme, null, null)); }  @Override boolean handles(TurkishSequence partialInput, TurkishSequence input); @Override List<ImmutableRoot> findRootsForPartialInput(TurkishSequence partialInput, TurkishSequence input); }
PuncRootFinder implements RootFinder { @Override public List<ImmutableRoot> findRootsForPartialInput(TurkishSequence partialInput, TurkishSequence input) { final ImmutableLexeme lexeme = new ImmutableLexeme(partialInput.getUnderlyingString(), input.getUnderlyingString(), PrimaryPos.Punctuation, null, null); return Arrays.asList(new ImmutableRoot(partialInput, lexeme, null, null)); }  @Override boolean handles(TurkishSequence partialInput, TurkishSequence input); @Override List<ImmutableRoot> findRootsForPartialInput(TurkishSequence partialInput, TurkishSequence input);  }