/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(final String value1, final String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(String value1, String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
public void doubleMetaphoneNotEqualTest(final boolean alternate) { assertFalse(this.getStringEncoder().isDoubleMetaphoneEqual("Brain", "Band", alternate)); assertFalse(this.getStringEncoder().isDoubleMetaphoneEqual("Band", "Brain", alternate)); if (!alternate) { assertFalse(this.getStringEncoder().isDoubleMetaphoneEqual("Brain", "Band")); assertFalse(this.getStringEncoder().isDoubleMetaphoneEqual("Band", "Brain")); } }
@Test public void testCodec184() throws Throwable { assertTrue(new DoubleMetaphone().isDoubleMetaphoneEqual("", "", false)); assertTrue(new DoubleMetaphone().isDoubleMetaphoneEqual("", "", true)); assertFalse(new DoubleMetaphone().isDoubleMetaphoneEqual("aa", "", false)); assertFalse(new DoubleMetaphone().isDoubleMetaphoneEqual("aa", "", true)); assertFalse(new DoubleMetaphone().isDoubleMetaphoneEqual("", "aa", false)); assertFalse(new DoubleMetaphone().isDoubleMetaphoneEqual("", "aa", true)); }
public void doubleMetaphoneEqualTest(final String[][] pairs, final boolean useAlternate) { this.validateFixture(pairs); for (final String[] pair : pairs) { final String name0 = pair[0]; final String name1 = pair[1]; final String failMsg = "Expected match between " + name0 + " and " + name1 + " (use alternate: " + useAlternate + ")"; assertTrue(failMsg, this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1, useAlternate)); assertTrue(failMsg, this.getStringEncoder().isDoubleMetaphoneEqual(name1, name0, useAlternate)); if (!useAlternate) { assertTrue(failMsg, this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1)); assertTrue(failMsg, this.getStringEncoder().isDoubleMetaphoneEqual(name1, name0)); } } }
final String name0 = FIXTURE[i][0]; final String name1 = FIXTURE[i][1]; final boolean match1 = this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1, false); final boolean match2 = this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1, true); if (match1 == false && match2 == false) { final String failMsg = "[" + i + "] " + name0 + " and " + name1 + cr;
@Test public void testIsDoubleMetaphoneEqualWithMATCHES() { this.validateFixture(MATCHES); for (int i = 0; i < MATCHES.length; i++) { final String name0 = MATCHES[i][0]; final String name1 = MATCHES[i][1]; final boolean match1 = this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1, false); final boolean match2 = this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1, true); if (match1 == false && match2 == false) { fail("Expected match [" + i + "] " + name0 + " and " + name1); } } }
@Test public void testNTilde() { assertTrue(this.getStringEncoder().isDoubleMetaphoneEqual("\u00f1", "N")); // n-tilde }
@Test public void testCCedilla() { assertTrue(this.getStringEncoder().isDoubleMetaphoneEqual("\u00e7", "S")); // c-cedilla }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(String value1, String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(String value1, String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(final String value1, final String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(final String value1, final String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(final String value1, final String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(final String value1, final String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return {@code true} if the encoded <code>String</code>s are equal; * {@code false} otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(final String value1, final String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(String value1, String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(String value1, String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }
/** * Check if the Double Metaphone values of two <code>String</code> values * are equal. * * @param value1 The left-hand side of the encoded {@link String#equals(Object)}. * @param value2 The right-hand side of the encoded {@link String#equals(Object)}. * @return <code>true</code> if the encoded <code>String</code>s are equal; * <code>false</code> otherwise. * @see #isDoubleMetaphoneEqual(String,String,boolean) */ public boolean isDoubleMetaphoneEqual(String value1, String value2) { return isDoubleMetaphoneEqual(value1, value2, false); }