@Test public void shouldApply() throws Exception { assertThat(applier.apply(suffixFormSequence, ImmutableSet.<PhoneticAttribute>of()), equalTo("")); assertThat(applier.apply(suffixFormSequence, ImmutableSet.of(PhoneticAttribute.LastLetterConsonant)), equalTo("c")); assertThat(applier.apply(suffixFormSequence, ImmutableSet.of(PhoneticAttribute.LastLetterVoicelessStop)), equalTo("b")); assertThat(applier.apply(suffixFormSequence, ImmutableSet.of(PhoneticAttribute.LastLetterVowel)), equalTo("")); }
public String apply(final SuffixFormSequence suffixFormSequence, final Set<PhoneticAttribute> phoneticAttributesOfSurface) { final StringBuilder builder = new StringBuilder(); for (SuffixFormSequence.SuffixFormSequenceRule rule : suffixFormSequence.getRules()) { final Character c = rule.apply(phoneticAttributesOfSurface); if (c != null) builder.append(c); } return builder.toString().trim(); }
SuffixFormSequenceApplier { public String apply(final SuffixFormSequence suffixFormSequence, final Set<PhoneticAttribute> phoneticAttributesOfSurface) { final StringBuilder builder = new StringBuilder(); for (SuffixFormSequence.SuffixFormSequenceRule rule : suffixFormSequence.getRules()) { final Character c = rule.apply(phoneticAttributesOfSurface); if (c != null) builder.append(c); } return builder.toString().trim(); } }
SuffixFormSequenceApplier { public String apply(final SuffixFormSequence suffixFormSequence, final Set<PhoneticAttribute> phoneticAttributesOfSurface) { final StringBuilder builder = new StringBuilder(); for (SuffixFormSequence.SuffixFormSequenceRule rule : suffixFormSequence.getRules()) { final Character c = rule.apply(phoneticAttributesOfSurface); if (c != null) builder.append(c); } return builder.toString().trim(); }  }
SuffixFormSequenceApplier { public String apply(final SuffixFormSequence suffixFormSequence, final Set<PhoneticAttribute> phoneticAttributesOfSurface) { final StringBuilder builder = new StringBuilder(); for (SuffixFormSequence.SuffixFormSequenceRule rule : suffixFormSequence.getRules()) { final Character c = rule.apply(phoneticAttributesOfSurface); if (c != null) builder.append(c); } return builder.toString().trim(); }  String apply(final SuffixFormSequence suffixFormSequence, final Set<PhoneticAttribute> phoneticAttributesOfSurface); boolean isApplicable(final SuffixFormSequence suffixFormSequence, final Set<PhoneticAttribute> phoneticAttributesOfSurface); }
SuffixFormSequenceApplier { public String apply(final SuffixFormSequence suffixFormSequence, final Set<PhoneticAttribute> phoneticAttributesOfSurface) { final StringBuilder builder = new StringBuilder(); for (SuffixFormSequence.SuffixFormSequenceRule rule : suffixFormSequence.getRules()) { final Character c = rule.apply(phoneticAttributesOfSurface); if (c != null) builder.append(c); } return builder.toString().trim(); }  String apply(final SuffixFormSequence suffixFormSequence, final Set<PhoneticAttribute> phoneticAttributesOfSurface); boolean isApplicable(final SuffixFormSequence suffixFormSequence, final Set<PhoneticAttribute> phoneticAttributesOfSurface);  }