@Test public void shouldGenerateWithVoicing() { { final Lexeme lexeme = new ImmutableLexeme("armut", "armut", PrimaryPos.Noun, null, ImmutableSet.of(LexemeAttribute.Voicing)); final HashSet<ImmutableRoot> generatedRoots = generator.generate(lexeme); assertThat(generatedRoots, hasSize(2)); assertThat(generatedRoots, hasItem(new ImmutableRoot("armut", lexeme, ImmutableSet.of(FLV, LVB, LLC, LLVless, LLVlessStop, LVR), ImmutableSet.of(PhoneticExpectation.ConsonantStart)))); assertThat(generatedRoots, hasItem(new ImmutableRoot("armud", lexeme, ImmutableSet.of(FLV, LVB, LLC, LLVless, LVR), ImmutableSet.of(PhoneticExpectation.VowelStart)))); } { final Lexeme lexeme = new ImmutableLexeme("kapak", "kapak", PrimaryPos.Noun, null, ImmutableSet.of(LexemeAttribute.Voicing)); final HashSet<ImmutableRoot> generatedRoots = generator.generate(lexeme); assertThat(generatedRoots, hasSize(2)); assertThat(generatedRoots, hasItem(new ImmutableRoot("kapak", lexeme, ImmutableSet.of(FLC, LVB, LLC, LLVless, LLVlessStop, LVU), ImmutableSet.of(PhoneticExpectation.ConsonantStart)))); assertThat(generatedRoots, hasItem(new ImmutableRoot("kapağ", lexeme, ImmutableSet.of(FLC, LVB, LLC, LLVless, LVU), ImmutableSet.of(PhoneticExpectation.VowelStart)))); } { final Lexeme lexeme = new ImmutableLexeme("cenk", "cenk", PrimaryPos.Noun, null, ImmutableSet.of(LexemeAttribute.Voicing)); final HashSet<ImmutableRoot> generatedRoots = generator.generate(lexeme); assertThat(generatedRoots, hasSize(2)); assertThat(generatedRoots, hasItem(new ImmutableRoot("cenk", lexeme, ImmutableSet.of(FLC, LVF, LLC, LLVless, LLVlessStop, LVU), ImmutableSet.of(PhoneticExpectation.ConsonantStart)))); assertThat(generatedRoots, hasItem(new ImmutableRoot("ceng", lexeme, ImmutableSet.of(FLC, LVF, LLC, LLVless, LVU), ImmutableSet.of(PhoneticExpectation.VowelStart)))); } { final Lexeme lexeme = new ImmutableLexeme("kap", "kap", PrimaryPos.Noun, null, ImmutableSet.of(LexemeAttribute.Voicing)); final HashSet<ImmutableRoot> generatedRoots = generator.generate(lexeme); assertThat(generatedRoots, hasSize(2)); assertThat(generatedRoots, hasItem(new ImmutableRoot("kap", lexeme, ImmutableSet.of(FLC, LVB, LLC, LLVless, LLVlessStop, LVU), ImmutableSet.of(PhoneticExpectation.ConsonantStart)))); assertThat(generatedRoots, hasItem(new ImmutableRoot("kab", lexeme, ImmutableSet.of(FLC, LVB, LLC, LLVless, 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);  }