@Test public void shouldThrowExceptionWhenPartialInputHasSameLengthWithWholeSurfaceButNotSameWithIt() { try { findRootsForPartialInput(" x", " a"); fail(); } catch (Exception e) { } try { findRootsForPartialInput(" .", " ,"); fail(); } catch (Exception e) { } try { findRootsForPartialInput("..!", "..."); fail(); } catch (Exception e) { } try { findRootsForPartialInput("!,.", "!,!"); fail(); } catch (Exception e) { } try { findRootsForPartialInput("'`", "''"); fail(); } catch (Exception e) { } }
@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);  }