Package com.ibm.icu.impl

Examples of com.ibm.icu.impl.Trie2$Range


  // always produce a result consisting of a set containing that script.
  void wholeScriptCheck(final CharSequence text, final ScriptSet result) {
    int inputIdx = 0;
    int c;

    Trie2 table = (0 != (fChecks & ANY_CASE)) ? fSpoofData.fAnyCaseTrie : fSpoofData.fLowerCaseTrie;
    result.setAll();
    while (inputIdx < text.length()) {
      c = Character.codePointAt(text, inputIdx);
      inputIdx = Character.offsetByCodePoints(text, inputIdx, 1);
      int index = table.get(c);
      if (index == 0) {
        // No confusables in another script for this char.
        // TODO: we should change the data to have sets with just the single script
        // bit for the script of this char. Gets rid of this special case.
        // Until then, grab the script from the char and intersect it with the set.
View Full Code Here


    public static Link[] selectAlternate(Entry entry) {
        return selectAlternate(entry, Locale.getDefault());
    }

    public static Link[] selectAlternate(Source source, Locale locale) {
        return selectAlternate(source, new Range(Lang.fromLocale(locale), true));
    }
View Full Code Here

    public static Link[] selectAlternate(Source source, Locale locale) {
        return selectAlternate(source, new Range(Lang.fromLocale(locale), true));
    }

    public static Link[] selectAlternate(Entry entry, Locale locale) {
        return selectAlternate(entry, new Range(Lang.fromLocale(locale), true));
    }
View Full Code Here

    }

    public static Link[] selectAlternate(Entry entry, Locale... locales) {
        Range[] ranges = new Range[locales.length];
        for (int n = 0; n < locales.length; n++)
            ranges[n] = new Range(Lang.fromLocale(locales[n]), true);
        return selectAlternate(entry, ranges);
    }
View Full Code Here

    }

    public static Link[] selectAlternate(Entry entry, String... ranges) {
        Range[] r = new Range[ranges.length];
        for (int n = 0; n < ranges.length; n++)
            r[n] = new Range(ranges[n], true);
        return selectAlternate(entry, r);
    }
View Full Code Here

    }

    public static Link[] selectAlternate(Source source, Locale... locales) {
        Range[] ranges = new Range[locales.length];
        for (int n = 0; n < locales.length; n++)
            ranges[n] = new Range(Lang.fromLocale(locales[n]), true);
        return selectAlternate(source, ranges);
    }
View Full Code Here

    }

    @Test
    public void test4647Matching() throws Exception {
        Lang lang = new Lang("en-Latn-US-valencia");
        Range range1 = new Range("*", true);
        Range range2 = new Range("en-*", true);
        Range range3 = new Range("en-Latn-*", true);
        Range range4 = new Range("en-US-*", true);
        Range range5 = new Range("en-*-US-*", true);
        Range range6 = new Range("*-US", true);
        Range range7 = new Range("*-valencia", true);
        Range range8 = new Range("*-FR", true);
        assertTrue(range1.matches(lang, true));
        assertTrue(range2.matches(lang, true));
        assertTrue(range3.matches(lang, true));
        assertTrue(range4.matches(lang, true));
        assertTrue(range5.matches(lang, true));
        assertTrue(range6.matches(lang, true));
        assertTrue(range7.matches(lang, true));
        assertFalse(range8.matches(lang, true));
    }
View Full Code Here

        String script = lang.getScript().getName();
        String region = lang.getRegion().getName();
        String variant = lang.getVariant().getName();

        // Perform extended range matching
        Range range = new Range("en-US-*", true);
        System.out.println(range.matches(lang, true));

        // Locale integration
        Locale locale = lang.getLocale();
        System.out.println(locale);
    }
View Full Code Here

    }

    public static Link[] selectAlternate(Source source, String... ranges) {
        Range[] r = new Range[ranges.length];
        for (int n = 0; n < ranges.length; n++)
            r[n] = new Range(ranges[n], true);
        return selectAlternate(source, r);
    }
View Full Code Here

            r[n] = new Range(ranges[n], true);
        return selectAlternate(source, r);
    }

    public static Link[] selectAlternate(List<Link> links, String range) {
        return selectAlternate(links, new Range(range, true));
    }
View Full Code Here

TOP

Related Classes of com.ibm.icu.impl.Trie2$Range

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.