@Test public void shouldGenerateWithLastVowelDrop() { { final Lexeme lexeme = new ImmutableLexeme("ağız", "ağız", PrimaryPos.Noun, null, ImmutableSet.of(LexemeAttribute.LastVowelDrop)); final HashSet<ImmutableRoot> generatedRoots = generator.generate(lexeme); assertThat(generatedRoots, hasSize(2)); assertThat(generatedRoots, hasItem(new ImmutableRoot("ağız", lexeme, ImmutableSet.of(FLV, LVB, LLC, LLNotVless, LVU), ImmutableSet.of(PhoneticExpectation.ConsonantStart)))); assertThat(generatedRoots, hasItem(new ImmutableRoot("ağz", lexeme, ImmutableSet.of(FLV, LVB, LLC, LLNotVless, LVU), ImmutableSet.of(PhoneticExpectation.VowelStart)))); } { final Lexeme lexeme = new ImmutableLexeme("ahit", "ahit", PrimaryPos.Noun, null, ImmutableSet.of(LexemeAttribute.LastVowelDrop, LexemeAttribute.Voicing)); final HashSet<ImmutableRoot> generatedRoots = generator.generate(lexeme); assertThat(generatedRoots, hasSize(2)); assertThat(generatedRoots, hasItem(new ImmutableRoot("ahit", lexeme, ImmutableSet.of(FLV, LVF, LLC, LLVless, LLVlessStop, LVU), ImmutableSet.of(PhoneticExpectation.ConsonantStart)))); assertThat(generatedRoots, hasItem(new ImmutableRoot("ahd", lexeme, ImmutableSet.of(FLV, LVF, LLVless, LLC, LVU), ImmutableSet.of(PhoneticExpectation.VowelStart)))); } }
public HashSet<ImmutableRoot> generate(final Lexeme lexeme) { if (CollectionUtils.containsAny(lexeme.getAttributes(), MODIFIERS_TO_WATCH)) { return this.generateModifiedRootNodes(lexeme); } else { Set<PhoneticAttribute> phoneticAttributes = phoneticsAnalyzer.calculatePhoneticAttributes(lexeme.getLemmaRoot(), lexeme.getAttributes()); final ImmutableRoot root = new ImmutableRoot(lexeme.getLemmaRoot(), lexeme, Sets.immutableEnumSet(phoneticAttributes), null); return Sets.newHashSet(root); } }
ImmutableRootGenerator { public HashSet<ImmutableRoot> generate(final Lexeme lexeme) { if (CollectionUtils.containsAny(lexeme.getAttributes(), MODIFIERS_TO_WATCH)) { return this.generateModifiedRootNodes(lexeme); } else { Set<PhoneticAttribute> phoneticAttributes = phoneticsAnalyzer.calculatePhoneticAttributes(lexeme.getLemmaRoot(), lexeme.getAttributes()); final ImmutableRoot root = new ImmutableRoot(lexeme.getLemmaRoot(), lexeme, Sets.immutableEnumSet(phoneticAttributes), null); return Sets.newHashSet(root); } } }
ImmutableRootGenerator { public HashSet<ImmutableRoot> generate(final Lexeme lexeme) { if (CollectionUtils.containsAny(lexeme.getAttributes(), MODIFIERS_TO_WATCH)) { return this.generateModifiedRootNodes(lexeme); } else { Set<PhoneticAttribute> phoneticAttributes = phoneticsAnalyzer.calculatePhoneticAttributes(lexeme.getLemmaRoot(), lexeme.getAttributes()); final ImmutableRoot root = new ImmutableRoot(lexeme.getLemmaRoot(), lexeme, Sets.immutableEnumSet(phoneticAttributes), null); return Sets.newHashSet(root); } }  }
ImmutableRootGenerator { public HashSet<ImmutableRoot> generate(final Lexeme lexeme) { if (CollectionUtils.containsAny(lexeme.getAttributes(), MODIFIERS_TO_WATCH)) { return this.generateModifiedRootNodes(lexeme); } else { Set<PhoneticAttribute> phoneticAttributes = phoneticsAnalyzer.calculatePhoneticAttributes(lexeme.getLemmaRoot(), lexeme.getAttributes()); final ImmutableRoot root = new ImmutableRoot(lexeme.getLemmaRoot(), lexeme, Sets.immutableEnumSet(phoneticAttributes), null); return Sets.newHashSet(root); } }  Collection<ImmutableRoot> generateAll(final Set<Lexeme> lexemes); HashSet<ImmutableRoot> generate(final Lexeme lexeme); }
ImmutableRootGenerator { public HashSet<ImmutableRoot> generate(final Lexeme lexeme) { if (CollectionUtils.containsAny(lexeme.getAttributes(), MODIFIERS_TO_WATCH)) { return this.generateModifiedRootNodes(lexeme); } else { Set<PhoneticAttribute> phoneticAttributes = phoneticsAnalyzer.calculatePhoneticAttributes(lexeme.getLemmaRoot(), lexeme.getAttributes()); final ImmutableRoot root = new ImmutableRoot(lexeme.getLemmaRoot(), lexeme, Sets.immutableEnumSet(phoneticAttributes), null); return Sets.newHashSet(root); } }  Collection<ImmutableRoot> generateAll(final Set<Lexeme> lexemes); HashSet<ImmutableRoot> generate(final Lexeme lexeme);  }