/** * Stringifies the phoneme set. This produces a single string of the strings of each phoneme, * joined with a pipe. This is explicitly provided in place of toString as it is a potentially * expensive operation, which should be avoided when debugging. * * @return the stringified phoneme set */ public String makeString() { final StringBuilder sb = new StringBuilder(); for (final Rule.Phoneme ph : this.phonemes) { if (sb.length() > 0) { sb.append("|"); } sb.append(ph.getPhonemeText()); } return sb.toString(); } }
final String phonemeText = phoneme.getPhonemeText().toString();
@Test public void testPhonemeComparedToLaterIsNegative() { for (final Rule.Phoneme[] phs : makePhonemes()) { for (int i = 0; i < phs.length; i++) { for (int j = i + 1; j < phs.length; j++) { final int c = Rule.Phoneme.COMPARATOR.compare(phs[i], phs[j]); assertThat("Comparing " + phs[i].getPhonemeText() + " to " + phs[j].getPhonemeText() + " should be negative", Integer.valueOf(c), new NegativeIntegerBaseMatcher()); } } } }
final String phonemeText = phoneme.getPhonemeText().toString();
final String phonemeText = phoneme.getPhonemeText().toString();
final String phonemeText = phoneme.getPhonemeText().toString();
final String phonemeText = phoneme.getPhonemeText().toString();
final String phonemeText = phoneme.getPhonemeText().toString();
/** * Stringifies the phoneme set. This produces a single string of the strings of each phoneme, * joined with a pipe. This is explicitly provided in place of toString as it is a potentially * expensive operation, which should be avoided when debugging. * * @return the stringified phoneme set */ public String makeString() { final StringBuilder sb = new StringBuilder(); for (final Rule.Phoneme ph : this.phonemes) { if (sb.length() > 0) { sb.append("|"); } sb.append(ph.getPhonemeText()); } return sb.toString(); } }
/** * Stringifies the phoneme set. This produces a single string of the strings of each phoneme, * joined with a pipe. This is explicitly provided in place of toString as it is a potentially * expensive operation, which should be avoided when debugging. * * @return the stringified phoneme set */ public String makeString() { final StringBuilder sb = new StringBuilder(); for (final Rule.Phoneme ph : this.phonemes) { if (sb.length() > 0) { sb.append("|"); } sb.append(ph.getPhonemeText()); } return sb.toString(); } }
/** * Stringifies the phoneme set. This produces a single string of the strings of each phoneme, * joined with a pipe. This is explicitly provided in place of toString as it is a potentially * expensive operation, which should be avoided when debugging. * * @return the stringified phoneme set */ public String makeString() { final StringBuilder sb = new StringBuilder(); for (final Rule.Phoneme ph : this.phonemes) { if (sb.length() > 0) { sb.append("|"); } sb.append(ph.getPhonemeText()); } return sb.toString(); } }
/** * Stringifies the phoneme set. This produces a single string of the strings of each phoneme, * joined with a pipe. This is explicitly provided in place of toString as it is a potentially * expensive operation, which should be avoided when debugging. * * @return the stringified phoneme set */ public String makeString() { final StringBuilder sb = new StringBuilder(); for (final Rule.Phoneme ph : this.phonemes) { if (sb.length() > 0) { sb.append("|"); } sb.append(ph.getPhonemeText()); } return sb.toString(); } }
/** * Stringifies the phoneme set. This produces a single string of the strings of each phoneme, * joined with a pipe. This is explicitly provided in place of toString as it is a potentially * expensive operation, which should be avoided when debugging. * * @return the stringified phoneme set */ public String makeString() { final StringBuilder sb = new StringBuilder(); for (final Rule.Phoneme ph : this.phonemes) { if (sb.length() > 0) { sb.append("|"); } sb.append(ph.getPhonemeText()); } return sb.toString(); } }
assertEquals('a', a.getPhonemeText().charAt(0)); assertEquals('b', b.getPhonemeText().charAt(0)); assertEquals('c', cd.getPhonemeText().charAt(0)); assertEquals('d', cd.getPhonemeText().charAt(1)); assertEquals('e', ef.getPhonemeText().charAt(0)); assertEquals('f', ef.getPhonemeText().charAt(1)); assertEquals('g', ghi.getPhonemeText().charAt(0)); assertEquals('h', ghi.getPhonemeText().charAt(1)); assertEquals('i', ghi.getPhonemeText().charAt(2)); assertEquals('j', jkl.getPhonemeText().charAt(0)); assertEquals('k', jkl.getPhonemeText().charAt(1)); assertEquals('l', jkl.getPhonemeText().charAt(2)); assertEquals('a', a_b.getPhonemeText().charAt(0)); assertEquals('b', a_b.getPhonemeText().charAt(1)); assertEquals("ab", a_b.getPhonemeText().subSequence(0, 2).toString()); assertEquals("a", a_b.getPhonemeText().subSequence(0, 1).toString()); assertEquals("b", a_b.getPhonemeText().subSequence(1, 2).toString()); assertEquals('c', cd_ef.getPhonemeText().charAt(0)); assertEquals('d', cd_ef.getPhonemeText().charAt(1)); assertEquals('e', cd_ef.getPhonemeText().charAt(2)); assertEquals('f', cd_ef.getPhonemeText().charAt(3)); assertEquals("c", cd_ef.getPhonemeText().subSequence(0, 1).toString()); assertEquals("d", cd_ef.getPhonemeText().subSequence(1, 2).toString()); assertEquals("e", cd_ef.getPhonemeText().subSequence(2, 3).toString()); assertEquals("f", cd_ef.getPhonemeText().subSequence(3, 4).toString()); assertEquals("cd", cd_ef.getPhonemeText().subSequence(0, 2).toString()); assertEquals("de", cd_ef.getPhonemeText().subSequence(1, 3).toString());
@Test public void testPhonemeComparedToSelfIsZero() { for (final Rule.Phoneme[] phs : makePhonemes()) { for (final Rule.Phoneme ph : phs) { assertEquals("Phoneme compared to itself should be zero: " + ph.getPhonemeText(), 0, Rule.Phoneme.COMPARATOR.compare(ph, ph)); } } }