ICU-12985 Bringing SpoofChecker documentation back in sync with unit test.

X-SVN-Rev: 40115
This commit is contained in:
Shane Carr 2017-05-06 02:39:49 +00:00
parent 85af08c09d
commit b9f7feaf26
2 changed files with 10 additions and 7 deletions

View file

@ -46,8 +46,8 @@ import com.ibm.icu.util.ULocale;
* <a href="http://unicode.org/reports/tr39">Unicode Technical Standard #39</a>, has two main functions:
*
* <ol>
* <li>Checking whether two strings are visually <em>confusable</em> with each other, such as "desordenado" and
* "ԁеѕогԁепаԁо".</li>
* <li>Checking whether two strings are visually <em>confusable</em> with each other, such as "desparejado" and
* "ԁеѕрагејаԁо".</li>
* <li>Checking whether an individual string is likely to be an attempt at confusing the reader (<em>spoof
* detection</em>), such as "pаypаl" spelled with Cyrillic 'а' characters.</li>
* </ol>
@ -65,7 +65,7 @@ import com.ibm.icu.util.ULocale;
* <pre>
* <code>
* SpoofChecker sc = new SpoofChecker.Builder().setChecks(SpoofChecker.CONFUSABLE).build();
* int result = sc.areConfusable("desordenado", "ԁеѕогԁепаԁо");
* int result = sc.areConfusable("desparejado", "ԁеѕрагејаԁо");
* System.out.println(result != 0); // true
* </code>
* </pre>
@ -89,7 +89,7 @@ import com.ibm.icu.util.ULocale;
* <pre>
* <code>
* SpoofChecker sc = new SpoofChecker.Builder().setChecks(SpoofChecker.CONFUSABLE).build();
* boolean result = sc.getSkeleton("desordenado").equals(sc.getSkeleton("ԁеѕогԁепаԁо"));
* boolean result = sc.getSkeleton("desparejado").equals(sc.getSkeleton("ԁеѕрагејаԁо"));
* System.out.println(result); // true
* </code>
* </pre>

View file

@ -469,9 +469,12 @@ public class SpoofCheckerTest extends TestFmwk {
// The spoof checker should only return those tests that the user requested. This test makes sure that
// the checker doesn't return anything the user doesn't want. This test started passing in ICU 58.
String latn = "horario";
String cyrl = "һогагіо";
String mixed = "һоrarіо";
// NOTE: These strings are the same ones as in the documentation. If the confusables data changes
// and this test breaks, pick a new confusables pair, update it here, and also update it in the
// documentation of SpoofChecker.java.
String latn = "desparejado";
String cyrl = "ԁеѕрагејаԁо";
String mixed = "dеsраrејаdо";
Object[][] tests = {
// string 1, string 2, checks for spoof checker, expected output