Package com.ibm.icu.text

Examples of com.ibm.icu.text.Transliterator.transform()


    }
   
    public void TestContext() {
        Transliterator t = Transliterator.createFromRules("foo", "::[bc]; a{b}d > B;", Transliterator.FORWARD);
        String sample = "abd abc b";
        assertEquals("context works", "aBd abc b", t.transform(sample));
    }

    public void TestScripts(){
        // get a couple of characters of each script for testing
       
View Full Code Here


                logln("Skipping unavailable: " + scriptName);
                continue; // we don't handle all scripts
            }
            logln("Checking: " + scriptName);
            if (t != null) {
                t.transform(test); // just verify we don't crash
            }
            scriptName = UScript.getShortName(script);
            t = Transliterator.getInstance("any-" + scriptName);
            t.transform(test); // just verify we don't crash
        }
View Full Code Here

            if (t != null) {
                t.transform(test); // just verify we don't crash
            }
            scriptName = UScript.getShortName(script);
            t = Transliterator.getInstance("any-" + scriptName);
            t.transform(test); // just verify we don't crash
        }
    }
   
    /**
     * Check to make sure that wide characters are converted when going to narrow scripts.
View Full Code Here

        String widePunctOnly = widen.transform(punctOnly);
        assertContainsNone("Should be wide", ASCII, wideLettersAndSpace);
        assertContainsNone("Should be wide", ASCII, widePunctOnly);
       
        String back;
        back = narrow.transform(wideLettersAndSpace);
        assertEquals("Should be narrow", lettersAndSpace, back);
        back = narrow.transform(widePunctOnly);
        assertEquals("Should be narrow", punctOnly, back);
       
        Transliterator latin = Transliterator.getInstance("any-Latn");
View Full Code Here

        assertContainsNone("Should be wide", ASCII, widePunctOnly);
       
        String back;
        back = narrow.transform(wideLettersAndSpace);
        assertEquals("Should be narrow", lettersAndSpace, back);
        back = narrow.transform(widePunctOnly);
        assertEquals("Should be narrow", punctOnly, back);
       
        Transliterator latin = Transliterator.getInstance("any-Latn");
        back = latin.transform(wideLettersAndSpace);
        assertEquals("Should be ascii", lettersAndSpace, back);
View Full Code Here

        assertEquals("Should be narrow", lettersAndSpace, back);
        back = narrow.transform(widePunctOnly);
        assertEquals("Should be narrow", punctOnly, back);
       
        Transliterator latin = Transliterator.getInstance("any-Latn");
        back = latin.transform(wideLettersAndSpace);
        assertEquals("Should be ascii", lettersAndSpace, back);
       
        back = latin.transform(widePunctOnly);
        assertEquals("Should be ascii", punctOnly, back);
      
View Full Code Here

       
        Transliterator latin = Transliterator.getInstance("any-Latn");
        back = latin.transform(wideLettersAndSpace);
        assertEquals("Should be ascii", lettersAndSpace, back);
       
        back = latin.transform(widePunctOnly);
        assertEquals("Should be ascii", punctOnly, back);
      
        Transliterator t2 = Transliterator.getInstance("any-Han");
        back = t2.transform(widePunctOnly);
        assertEquals("Should be same", widePunctOnly, back);
View Full Code Here

       
        back = latin.transform(widePunctOnly);
        assertEquals("Should be ascii", punctOnly, back);
      
        Transliterator t2 = Transliterator.getInstance("any-Han");
        back = t2.transform(widePunctOnly);
        assertEquals("Should be same", widePunctOnly, back);


    }
   
View Full Code Here

        String arabicDigits = getList(arabicDigitSet);

        String fromArabic = latin.transform(arabicDigits);
        assertContainsAll("Any-Latin transforms Arabic digits", westernDigitSetAndMarks, fromArabic);
        if (false) { // we don't require conversion to Arabic digits
            String fromLatin = arabic.transform(westernDigits);
            assertContainsAll("Any-Arabic transforms Western digits", arabicDigitSet, fromLatin);
        }
    }

    // might want to add to TestFmwk
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.