Search in sources :

Example 1 with Normalizer

use of android.icu.text.Normalizer in project j2objc by google.

the class BasicTest method TestHangulCompose.

@Test
public void TestHangulCompose() throws Exception {
    // Make sure that the static composition methods work
    logln("Canonical composition...");
    staticTest(Normalizer.NFC, hangulCanon, 2);
    logln("Compatibility composition...");
    staticTest(Normalizer.NFKC, hangulCompat, 2);
    // Now try iterative composition....
    logln("Iterative composition...");
    Normalizer norm = new Normalizer("", Normalizer.NFC, 0);
    iterateTest(norm, hangulCanon, 2);
    norm.setMode(Normalizer.NFKD);
    iterateTest(norm, hangulCompat, 2);
    // And finally, make sure you can do it in reverse too
    logln("Reverse iteration...");
    norm.setMode(Normalizer.NFC);
    backAndForth(norm, hangulCanon);
}
Also used : Normalizer(android.icu.text.Normalizer) Test(org.junit.Test)

Example 2 with Normalizer

use of android.icu.text.Normalizer in project j2objc by google.

the class BasicTest method TestCompatDecomp.

@Test
public void TestCompatDecomp() throws Exception {
    Normalizer norm = new Normalizer("", Normalizer.NFKD, 0);
    iterateTest(norm, compatTests, 1);
    staticTest(Normalizer.NFKD, compatTests, 1);
    decomposeTest(Normalizer.NFKD, compatTests, 1);
}
Also used : Normalizer(android.icu.text.Normalizer) Test(org.junit.Test)

Example 3 with Normalizer

use of android.icu.text.Normalizer in project j2objc by google.

the class BasicTest method TestDecomp.

@Test
public void TestDecomp() throws Exception {
    Normalizer norm = new Normalizer("", Normalizer.NFD, 0);
    iterateTest(norm, canonTests, 1);
    staticTest(Normalizer.NFD, canonTests, 1);
    decomposeTest(Normalizer.NFD, canonTests, 1);
}
Also used : Normalizer(android.icu.text.Normalizer) Test(org.junit.Test)

Example 4 with Normalizer

use of android.icu.text.Normalizer in project j2objc by google.

the class BasicTest method TestCompatCompose.

@Test
public void TestCompatCompose() throws Exception {
    Normalizer norm = new Normalizer("", Normalizer.NFKC, 0);
    iterateTest(norm, compatTests, 2);
    staticTest(Normalizer.NFKC, compatTests, 2);
    composeTest(Normalizer.NFKC, compatTests, 2);
}
Also used : Normalizer(android.icu.text.Normalizer) Test(org.junit.Test)

Example 5 with Normalizer

use of android.icu.text.Normalizer in project j2objc by google.

the class BasicTest method TestCanonCompose.

@Test
public void TestCanonCompose() throws Exception {
    Normalizer norm = new Normalizer("", Normalizer.NFC, 0);
    iterateTest(norm, canonTests, 2);
    staticTest(Normalizer.NFC, canonTests, 2);
    composeTest(Normalizer.NFC, canonTests, 2);
}
Also used : Normalizer(android.icu.text.Normalizer) Test(org.junit.Test)

Aggregations

Normalizer (android.icu.text.Normalizer)14 Test (org.junit.Test)14 UCharacterIterator (android.icu.text.UCharacterIterator)3 StringCharacterIterator (java.text.StringCharacterIterator)3 StringCharacterIterator (android.icu.text.StringCharacterIterator)1