Package com.ibm.icu.text

Examples of com.ibm.icu.text.Bidi$Point


public class TestFailureRecovery extends BidiTest {

    public void testFailureRecovery()
    {
        logln("\nEntering TestFailureRecovery\n");
        Bidi bidi = new Bidi();
        try {
            bidi.setPara("abc", (byte)(Bidi.LEVEL_DEFAULT_LTR - 1), null);
            errln("Bidi.setPara did not fail when passed too big para level");
        } catch (IllegalArgumentException e) {
            logln("OK: Got exception for bidi.setPara(..., Bidi.LEVEL_DEFAULT_LTR - 1, ...)"
                    + " as expected: " + e.getMessage());
        }
        try {
            bidi.setPara("abc", (byte)(-1), null);
            errln("Bidi.setPara did not fail when passed negative para level");
        } catch (IllegalArgumentException e) {
            logln("OK: Got exception for bidi.setPara(..., -1, ...)"
                    + " as expected: " + e.getMessage());
        }
        try {
            Bidi.writeReverse(null, 0);
            errln("Bidi.writeReverse did not fail when passed a null string");
        } catch (IllegalArgumentException e) {
            logln("OK: Got exception for Bidi.writeReverse(null) as expected: "
                  + e.getMessage());
        }
        bidi = new Bidi();
        try {
            bidi.setLine(0, 1);
            errln("bidi.setLine did not fail when called before valid setPara()");
        } catch (IllegalStateException e) {
            logln("OK: Got exception for Bidi.setLine(0, 1) as expected: "
                  + e.getMessage());
        }
        try {
            bidi.getDirection();
            errln("bidi.getDirection did not fail when called before valid setPara()");
        } catch (IllegalStateException e) {
            logln("OK: Got exception for Bidi.getDirection() as expected: "
                  + e.getMessage());
        }
        bidi.setPara("abc", Bidi.LTR, null);
        try {
            bidi.getLevelAt(3);
            errln("bidi.getLevelAt did not fail when called with bad argument");
        } catch (IllegalArgumentException e) {
            logln("OK: Got exception for Bidi.getLevelAt(3) as expected: "
                  + e.getMessage());
        }
        try {
            bidi = new Bidi(-1, 0);
            errln("Bidi constructor did not fail when called with bad argument");
        } catch (IllegalArgumentException e) {
            logln("OK: Got exception for Bidi(-1,0) as expected: "
                  + e.getMessage());
        }
        bidi = new Bidi(2, 1);
        try {
            bidi.setPara("abc", Bidi.LTR, null);
            errln("setPara did not fail when called with text too long");
        } catch (OutOfMemoryError e) {
            logln("OK: Got exception for setPara(\"abc\") as expected: "
                  + e.getMessage());
        }
        try {
            bidi.setPara("=2", Bidi.RTL, null);
            bidi.countRuns();
            errln("countRuns did not fail when called for too many runs");
        } catch (OutOfMemoryError e) {
            logln("OK: Got exception for countRuns as expected: "
                  + e.getMessage());
        }
        int rm = bidi.getReorderingMode();
        bidi.setReorderingMode(Bidi.REORDER_DEFAULT - 1);
        if (rm != bidi.getReorderingMode()) {
            errln("setReorderingMode with bad argument #1 should have no effect");
        }
        bidi.setReorderingMode(9999);
        if (rm != bidi.getReorderingMode()) {
            errln("setReorderingMode with bad argument #2 should have no effect");
        }
        /* Try a surrogate char */
        bidi = new Bidi();
        bidi.setPara("\uD800\uDC00", Bidi.RTL, null);
        if (bidi.getDirection() != Bidi.MIXED) {
            errln("getDirection for 1st surrogate char should be MIXED");
        }
        byte[] levels = new byte[] {6,5,4};
        try {
            bidi.setPara("abc", (byte)5, levels);
            errln("setPara did not fail when called with bad levels");
        } catch (IllegalArgumentException e) {
            logln("OK: Got exception for setPara(..., levels) as expected: "
                  + e.getMessage());
        }
View Full Code Here


    {
        byte gotLevel;
        byte[] gotLevels;
        boolean orderParagraphsLTR;
        String src;
        Bidi bidi = new Bidi();
        Bidi bidiLine;
        int count, paraStart, paraLimit, paraIndex, length;
        int i, j, k;

        logln("\nEntering TestMultipleParagraphs\n");
        try {
            bidi.setPara(text, Bidi.LTR, null);
        } catch (IllegalArgumentException e) {
            errln("1st Bidi.setPara failed, paraLevel = " + Bidi.LTR);
        }

        /* check paragraph count and boundaries */
        if (paraCount != (count = bidi.countParagraphs())) {
            errln("1st Bidi.countParagraphs returned " + count + ", should be " +
                  paraCount);
        }
        BidiRun run;
        for (i = 0; i < paraCount; i++) {
            run = bidi.getParagraphByIndex(i);
            paraStart = run.getStart();
            paraLimit = run.getLimit();
            if ((paraStart != paraBounds[i]) ||
                (paraLimit != paraBounds[i + 1])) {
                errln("Found boundaries of paragraph " + i + ": " +
                      paraStart + "-" + paraLimit + "; expected: " +
                      paraBounds[i] + "-" + paraBounds[i + 1]);
            }
        }

        /* check with last paragraph not terminated by B */
        char[] chars = text.toCharArray();
        chars[chars.length - 1] = 'L';
        src = new String(chars);
        try {
            bidi.setPara(src, Bidi.LTR, null);
        } catch (IllegalArgumentException e) {
            errln("2nd Bidi.setPara failed, paraLevel = " + Bidi.LTR);
        }
        if (paraCount != (count = bidi.countParagraphs())) {
            errln("2nd Bidi.countParagraphs returned " + count +
                  ", should be " + paraCount);
        }
        i = paraCount - 1;
        run = bidi.getParagraphByIndex(i);
        paraStart = run.getStart();
        paraLimit = run.getLimit();
        if ((paraStart != paraBounds[i]) ||
            (paraLimit != paraBounds[i + 1])) {
            errln("2nd Found boundaries of paragraph " + i + ": " +
                  paraStart + "-" + paraLimit + "; expected: " +
                  paraBounds[i] + "-" + paraBounds[i + 1]);
        }

        /* check paraLevel for all paragraphs under various paraLevel specs */
        for (k = 0; k < 6; k++) {
            try {
                bidi.setPara(src, paraLevels[k], null);
            } catch (IllegalArgumentException e) {
                errln("3nd Bidi.setPara failed, paraLevel = " + paraLevels[k]);
            }
            for (i = 0; i < paraCount; i++) {
                paraIndex = bidi.getParagraphIndex(paraBounds[i]);
                run = bidi.getParagraph(paraBounds[i]);
                if (paraIndex != i) {
                    errln("#1 For paraLevel = " + paraLevels[k] +
                          " paragraph = " + i + ", found paragraph" +
                          " index = " + paraIndex + " expected = " + i);
                }
                gotLevel = run.getEmbeddingLevel();
                if (gotLevel != multiLevels[k][i]) {
                    errln("#2 For paraLevel = " + paraLevels[k] +
                          " paragraph = " + i + ", found level = " + gotLevel +
                          ", expected = " + multiLevels[k][i]);
                }
            }
            gotLevel = bidi.getParaLevel();
            if (gotLevel != multiLevels[k][0]) {
                errln("#3 For paraLevel = " + paraLevels[k] +
                      " getParaLevel = " + gotLevel + ", expected " +
                      multiLevels[k][0]);
            }
        }

        /* check that the result of Bidi.getParaLevel changes if the first
         * paragraph has a different level
         */
        chars[0] = '\u05d2';            /* Hebrew letter Gimel */
        src = new String(chars);
        try {
            bidi.setPara(src, Bidi.LEVEL_DEFAULT_LTR, null);
        } catch (IllegalArgumentException e) {
            errln("Bidi.setPara failed, paraLevel = " + Bidi.LEVEL_DEFAULT_LTR);
        }
        gotLevel = bidi.getParaLevel();
        if (gotLevel != Bidi.RTL) {
            errln("#4 For paraLevel = Bidi.LEVEL_DEFAULT_LTR getParaLevel = " +
                  gotLevel + ", expected = " + Bidi.RTL);
        }

        /* check that line cannot overlap paragraph boundaries */
        bidiLine = new Bidi();
        i = paraBounds[1];
        k = paraBounds[2] + 1;
        try {
            bidiLine = bidi.setLine(i, k);
            errln("For line limits " + i + "-" + k
                    + " got success, while expected failure");
        } catch (Exception e) {}

        i = paraBounds[1];
        k = paraBounds[2];
        try {
            bidiLine = bidi.setLine(i, k);
        } catch (Exception e) {
            errln("For line limits " + i + "-" + k + " got failure");
        }

        /* check level of block separator at end of paragraph when orderParagraphsLTR==FALSE */
        try {
            bidi.setPara(src, Bidi.RTL, null);
        } catch (IllegalArgumentException e) {
            errln("Bidi.setPara failed, paraLevel = " + Bidi.RTL);
        }
        /* get levels through para Bidi block */
        try {
            gotLevels = bidi.getLevels();
        } catch (Exception e) {
            errln("Error on Bidi.getLevels");
            gotLevels = new byte[bidi.getLength()];
            Arrays.fill(gotLevels, (byte)-1);
        }
        for (i = 26; i < 32; i++) {
            if (gotLevels[i] != Bidi.RTL) {
                errln("For char " + i + "(0x" + Utility.hex(chars[i]) +
                      "), level = " + gotLevels[i] + ", expected = " + Bidi.RTL);
            }
        }
        /* get levels through para Line block */
        i = paraBounds[1];
        k = paraBounds[2];
        try {
            bidiLine = bidi.setLine(i, k);
        } catch (Exception e) {
            errln("For line limits " + i + "-" + k + " got failure");
            return;
        }
        paraIndex = bidiLine.getParagraphIndex(i);
        run = bidiLine.getParagraph(i);
        try {
            gotLevels = bidiLine.getLevels();
        } catch (Exception e) {
            errln("Error on bidiLine.getLevels");
            gotLevels = new byte[bidiLine.getLength()];
            Arrays.fill(gotLevels, (byte)-1);
        }
        length = bidiLine.getLength();
        gotLevel = run.getEmbeddingLevel();
        if ((gotLevel != Bidi.RTL) || (gotLevels[length - 1] != Bidi.RTL)) {
            errln("For paragraph " + paraIndex + " with limits " +
                  run.getStart() + "-" + run.getLimit() +
                  ", paraLevel = " + gotLevel +
                  "expected = " + Bidi.RTL +
                  ", level of separator = " + gotLevels[length - 1] +
                  " expected = " + Bidi.RTL);
        }
        orderParagraphsLTR = bidi.isOrderParagraphsLTR();
        assertFalse("orderParagraphsLTR is true", orderParagraphsLTR);
        bidi.orderParagraphsLTR(true);
        orderParagraphsLTR = bidi.isOrderParagraphsLTR();
        assertTrue("orderParagraphsLTR is false", orderParagraphsLTR);

        /* check level of block separator at end of paragraph when orderParagraphsLTR==TRUE */
        try {
            bidi.setPara(src, Bidi.RTL, null);
        } catch (IllegalArgumentException e) {
            errln("Bidi.setPara failed, paraLevel = " + Bidi.RTL);
        }
        /* get levels through para Bidi block */
        try {
            gotLevels = bidi.getLevels();
        } catch (Exception e) {
            errln("Error on Bidi.getLevels");
            gotLevels = new byte[bidi.getLength()];
            Arrays.fill(gotLevels, (byte)-1);
        }
        for (i = 26; i < 32; i++) {
            if (gotLevels[i] != 0) {
                errln("For char " + i + "(0x" + Utility.hex(chars[i]) +
                      "), level = "+ gotLevels[i] + ", expected = 0");
            }
        }
        /* get levels through para Line block */
        i = paraBounds[1];
        k = paraBounds[2];
        paraStart = run.getStart();
        paraLimit = run.getLimit();
        try {
            bidiLine = bidi.setLine(paraStart, paraLimit);
        } catch (Exception e) {
            errln("For line limits " + paraStart + "-" + paraLimit +
                  " got failure");
        }
        paraIndex = bidiLine.getParagraphIndex(i);
        run = bidiLine.getParagraph(i);
        try {
            gotLevels = bidiLine.getLevels();
        } catch (Exception e) {
            errln("Error on bidiLine.getLevels");
            gotLevels = new byte[bidiLine.getLength()];
            Arrays.fill(gotLevels, (byte)-1);
        }
        length = bidiLine.getLength();
        gotLevel = run.getEmbeddingLevel();
        if ((gotLevel != Bidi.RTL) || (gotLevels[length - 1] != 0)) {
            err("\nFor paragraph " + paraIndex + " with limits " +
                run.getStart() + "-" + run.getLimit() +
                ", paraLevel = " + gotLevel + "expected = " + Bidi.RTL +
                ", level of separator = " + gotLevels[length - 1] +
                " expected = 0\nlevels = ");
            for (count = 0; count < length; count++) {
                errcont(gotLevels[count] + "  ");
            }
            errcont("\n");
        }

        /* test that the concatenation of separate invocations of the bidi code
         * on each individual paragraph in order matches the levels array that
         * results from invoking bidi once over the entire multiparagraph tests
         * (with orderParagraphsLTR false, of course)
         */
        src = text;                     /* restore original content */
        bidi.orderParagraphsLTR(false);
        try {
            bidi.setPara(src, Bidi.LEVEL_DEFAULT_RTL, null);
        } catch (IllegalArgumentException e) {
            errln("Bidi.setPara failed, paraLevel = " + Bidi.LEVEL_DEFAULT_RTL);
        }
        try {
            gotLevels = bidi.getLevels();
        } catch (Exception e) {
            errln("Error on bidiLine.getLevels");
            gotLevels = new byte[bidi.getLength()];
            Arrays.fill(gotLevels, (byte)-1);
        }
        for (i = 0; i < paraCount; i++) {
            /* use pLine for individual paragraphs */
            paraStart = paraBounds[i];
            length = paraBounds[i + 1] - paraStart;
            try {
                bidiLine.setPara(src.substring(paraStart, paraStart + length),
                                 Bidi.LEVEL_DEFAULT_RTL, null);
            } catch (IllegalArgumentException e) {
                errln("Bidi.setPara failed, paraLevel = " + Bidi.LEVEL_DEFAULT_RTL);
            }
            for (j = 0; j < length; j++) {
                if ((k = bidiLine.getLevelAt(j)) !=
                        (gotLevel = gotLevels[paraStart + j])) {
                    errln("Checking paragraph concatenation: for paragraph[" +
                          i + "], char[" + j + "] = 0x" +
                          Utility.hex(src.charAt(paraStart + j)) +
                          ", level = " + k + ", expected = " + gotLevel);
                }
            }
        }

        /* ensure that leading numerics in a paragraph are not treated as arabic
           numerals because of arabic text in a preceding paragraph
         */
        src = text2;
        bidi.orderParagraphsLTR(true);
        try {
            bidi.setPara(src, Bidi.RTL, null);
        } catch (IllegalArgumentException e) {
            errln("Bidi.setPara failed, paraLevel = " + Bidi.RTL);
        }
        try {
            gotLevels = bidi.getLevels();
        } catch (Exception e) {
            errln("Error on Bidi.getLevels");
            gotLevels = new byte[bidi.getLength()];
            Arrays.fill(gotLevels, (byte)-1);
        }
        for (i = 0, length = src.length(); i < length; i++) {
            if (gotLevels[i] != levels2[i]) {
                errln("Checking leading numerics: for char " + i + "(0x" +
                      Utility.hex(src.charAt(i)) + "), level = " +
                      gotLevels[i] + ", expected = " + levels2[i]);
            }
        }

        /* check handling of whitespace before end of paragraph separator when
         * orderParagraphsLTR==TRUE, when last paragraph has, and lacks, a terminating B
         */
        chars = src.toCharArray();
        Arrays.fill(chars, '\u0020');
        bidi.orderParagraphsLTR(true);
        for (i = 0x001c; i <= 0x0020; i += (0x0020-0x001c)) {
            chars[4] = (char)i;         /* with and without terminating B */
            for (j = 0x0041; j <= 0x05d0; j += (0x05d0-0x0041)) {
                chars[0] = (char)j;     /* leading 'A' or Alef */
                src = new String(chars);
                for (gotLevel = 4; gotLevel <= 5; gotLevel++) {
                    /* test even and odd paraLevel */
                    try {
                        bidi.setPara(src, gotLevel, null);
                    } catch (IllegalArgumentException e) {
                        errln("Bidi.setPara failed, paraLevel = " + gotLevel);
                    }
                    try {
                        gotLevels = bidi.getLevels();
                    } catch (Exception e) {
                        errln("Error on Bidi.getLevels");
                        gotLevels = new byte[bidi.getLength()];
                        Arrays.fill(gotLevels, (byte)-1);
                    }
                    for (k = 1; k <= 3; k++) {
                        if (gotLevels[k] != gotLevel) {
                            errln("Checking trailing spaces for leading char 0x" +
                                  Utility.hex(chars[0]) + ", last_char = " +
                                  Utility.hex(chars[4]) + ", index = " + k +
                                  "level = " + gotLevels[k] +
                                  ", expected = " + gotLevel);
                        }
                    }
                }
            }
        }

        /* check default orientation when inverse bidi and paragraph starts
         * with LTR strong char and ends with RTL strong char, with and without
         * a terminating B
         */
        bidi.setReorderingMode(Bidi.REORDER_INVERSE_LIKE_DIRECT);
        bidi.setPara("abc \u05d2\u05d1\n", Bidi.LEVEL_DEFAULT_LTR, null);
        String out = bidi.writeReordered(0);
        assertEquals("\nInvalid output", "\u05d1\u05d2 abc\n", out);
        bidi.setPara("abc \u05d2\u05d1", Bidi.LEVEL_DEFAULT_LTR, null);
        out = bidi.writeReordered(0);
        assertEquals("\nInvalid output #1", "\u05d1\u05d2 abc", out);

        /* check multiple paragraphs together with explicit levels
         */
        bidi.setReorderingMode(Bidi.REORDER_DEFAULT);
        gotLevels = new byte[] {0,0,0,0,0,0,0,0,0,0};
        bidi.setPara("ab\u05d1\u05d2\n\u05d3\u05d4123", Bidi.LTR, gotLevels);
        out = bidi.writeReordered(0);
        assertEquals("\nInvalid output #2", "ab\u05d2\u05d1\n123\u05d4\u05d3", out);
        assertEquals("\nInvalid number of paras", 2, bidi.countParagraphs());

        logln("\nExiting TestMultipleParagraphs\n");

        /* check levels in multiple paragraphs with default para level
         */
        bidi = new Bidi();
        bidi.setPara(multiparaTestString, Bidi.LEVEL_DEFAULT_LTR, null);
        try {
            gotLevels = bidi.getLevels();
        } catch (Exception e) {
            errln("Error on Bidi.getLevels for multiparaTestString");
View Full Code Here

                     new int[] {0, 0})
    };

    public void testReorderRunsOnly() {

        Bidi bidi = new Bidi();
        Bidi bidiL2V = new Bidi();
        String src, dest, visual1, visual2;
        String srcU16, destU16, visual1U16, visual2U16;
        int option, i, j, nCases;
        byte level;

        logln("\nEntering TestReorderRunsOnly\n");
        bidi.setReorderingMode(Bidi.REORDER_RUNS_ONLY);
        bidiL2V.setReorderingOptions(Bidi.OPTION_REMOVE_CONTROLS);

        for (option = 0; option < 2; option++) {
            bidi.setReorderingOptions(option == 0 ? Bidi.OPTION_REMOVE_CONTROLS
                                                  : Bidi.OPTION_INSERT_MARKS);
            for (i = 0, nCases = testCases.length; i < nCases; i++) {
                src = testCases[i].textIn;
                srcU16 = pseudoToU16(src);
                for (j = 0; j < 2; j++) {
                    logln("Now doing test for option " + option +
                          ", case " + i + ", level " + j);
                    level = (byte)j;
                    bidi.setPara(srcU16, level, null);
                    destU16 = bidi.writeReordered(Bidi.DO_MIRRORING);
                    dest = u16ToPseudo(destU16);
                    checkWhatYouCan(bidi, src, dest);
                    assertEquals("Reorder runs only failed for case " + i,
                                 testCases[i].textOut[option][level],
                                 dest, src, null, null, Byte.toString(level));

                    if ((option == 0) && (testCases[i].noroundtrip[level] > 0)) {
                        continue;
                    }
                    bidiL2V.setPara(srcU16, level, null);
                    visual1U16 = bidiL2V.writeReordered(Bidi.DO_MIRRORING);
                    visual1 = u16ToPseudo(visual1U16);
                    checkWhatYouCan(bidiL2V, src, visual1);
                    bidiL2V.setPara(destU16, (byte)(level^1), null);
                    visual2U16 = bidiL2V.writeReordered(Bidi.DO_MIRRORING);
                    visual2 = u16ToPseudo(visual2U16);
                    checkWhatYouCan(bidiL2V, dest, visual2);
                    assertEquals("Round trip failed for case " + i,
                                 visual1, visual2, src,
                                 "REORDER_RUNS_ONLY (2)",
View Full Code Here

    static final byte[] paraLevels = { Bidi.LTR, Bidi.RTL };

    public void testStreaming()
    {
        String src, subsrc;
        Bidi bidi;
        int srcLen, processedLen, chunk, len, nPortions, offset;
        int i, j, levelIndex;
        byte level;
        int nTests = testCases.length, nLevels = paraLevels.length;
        boolean mismatch, testOK = true;
        StringBuffer processedLenStr = new StringBuffer(MAXLOOPS * 5);

        logln("\nEntering TestStreaming\n");

        bidi = new Bidi();

        bidi.orderParagraphsLTR(true);

        for (levelIndex = 0; levelIndex < nLevels; levelIndex++) {
            for (i = 0; i < nTests; i++) {
                src = testCases[i].textIn;
                srcLen = src.length();
                chunk = testCases[i].chunk;
                nPortions = testCases[i].nPortions[levelIndex];
                level = paraLevels[levelIndex];
                processedLenStr.setLength(0);
                logln("Testing level " + level + ", case " + i);

                mismatch = false;

                bidi.setReorderingOptions(Bidi.OPTION_STREAMING);
                for (j = 0; j < MAXPORTIONS && srcLen > 0; j++) {
                    len = chunk < srcLen ? chunk : srcLen;
                    offset = src.length() - srcLen;
                    subsrc = src.substring(offset, offset + len);
                    bidi.setPara(subsrc, level, null);

                    processedLen = bidi.getProcessedLength();
                    if (processedLen == 0) {
                        bidi.setReorderingOptions(Bidi.OPTION_DEFAULT);
                        j--;
                        continue;
                    }
                    bidi.setReorderingOptions(Bidi.OPTION_STREAMING);

                    mismatch |= j >= nPortions ||
                               processedLen != testCases[i].portionLens[levelIndex][j];

                    processedLenStr.append(Integer.toString(processedLen) + " ");
View Full Code Here

        "\u0031\u0032\u0033\u0020\u05d0\u05d1\u05d2\u0020\u0034\u0035\u0036",
        "\u0061\u0062\u0020\u0061\u0062\u0020\u0661\u0662"
    };

    public void testInverse() {
        Bidi bidi;
        int i;

        logln("\nEntering TestInverse\n");
        bidi = new Bidi();
        log("inverse Bidi: testInverse(L) with " + testCases.length +
            " test cases ---\n");
        for(i = 0; i < testCases.length; ++i) {
            logln("Testing case " + i);
            _testInverseBidi(bidi, testCases[i], Bidi.DIRECTION_LEFT_TO_RIGHT);
View Full Code Here

        }
        log(" }");
    }

    private void _testManyAddedPoints() {
        Bidi bidi = new Bidi();
        char[] text = new char[90];
        for (int i = 0; i < text.length; i+=3) {
            text[i] = 'a';
            text[i+1] = '\u05d0';
            text[i+2] = '3';
        }
        bidi.setReorderingMode(Bidi.REORDER_INVERSE_LIKE_DIRECT);
        bidi.setReorderingOptions(Bidi.OPTION_INSERT_MARKS);
        bidi.setPara(text, Bidi.LTR, null);
        String out = bidi.writeReordered(0);
        char[] expected = new char[120];
        for (int i = 0; i < expected.length; i+=4) {
            expected[i] = 'a';
            expected[i+1] = '\u05d0';
            expected[i+2] = '\u200e';
View Full Code Here

        assertEquals("\nInvalid output with many added points",
                     new String(expected), out);
    }

    private void _testMisc() {
        Bidi bidi = new Bidi();
        bidi.setInverse(true);
        bidi.setPara("   ", Bidi.RTL, null);
        String out = bidi.writeReordered(Bidi.OUTPUT_REVERSE | Bidi.INSERT_LRM_FOR_NUMERIC);
        assertEquals("\nInvalid output with RLM at both sides",
                     "\u200f   \u200f", out);
    }
View Full Code Here

    /**
     * Constructor.
     */
    public ICU4JImpl()
    {
        bidi = new Bidi();

        /* We do not use bidi.setInverse() because that uses
         * Bidi.REORDER_INVERSE_NUMBERS_AS_L, which caused problems
         * in some test files. For example, a file had a line of:
         * 0 1 / ARABIC
View Full Code Here

    /**
     * Constructor.
     */
    public ICU4JImpl()
    {
        bidi = new Bidi();

        /* We do not use bidi.setInverse() because that uses
         * Bidi.REORDER_INVERSE_NUMBERS_AS_L, which caused problems
         * in some test files. For example, a file had a line of:
         * 0 1 / ARABIC
View Full Code Here

    private String bidiReorder(String p_147647_1_)
    {
        try
        {
            Bidi bidi = new Bidi((new ArabicShaping(8)).shape(p_147647_1_), 127);
            bidi.setReorderingMode(0);
            return bidi.writeReordered(2);
        }
        catch (ArabicShapingException arabicshapingexception)
        {
            return p_147647_1_;
        }
View Full Code Here

TOP

Related Classes of com.ibm.icu.text.Bidi$Point

Copyright © 2018 www.massapicom. 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.