[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 

Changeset 11554


Ignore:
Timestamp:
04/24/15 13:08:10 (4 years ago)
Author:
mdavis
Message:

cldrbug 7366: collapse the levels. Will need to test with Smoke to see if we need to tweak pathheader

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/supplemental/coverageLevels.xml

    r11551 r11554  
    129129                <coverageVariable key="%shortLong" value="(short|long)"/> 
    130130                <coverageVariable key="%shortVariant" value="(short|variant)"/> 
    131                 <coverageVariable key="%anyVariant" value="([-a-zA-Z0-9]+)"/> 
     131                <coverageVariable key="%anyAlphaNum" value="([-a-zA-Z0-9]+)"/> 
    132132                <coverageVariable key="%standaloneVariant" value="(stand-alone|variant)"/> 
    133133                <coverageVariable key="%stdPattern" value="[@type='standard']/pattern[@type='standard']"/> 
     
    426426                <coverageLevel inTerritory="US" value="moderate" match="units/unitLength[@type='%unitLengths']/unit[@type='%unitsCommonUS']/unitPattern[@count='${Target-Plurals}']"/> 
    427427                <coverageLevel inTerritory="US" value="moderate" match="units/unitLength[@type='%unitLengths']/unit[@type='%unitsCommonUS']/displayName"/> 
     428 
    428429                <coverageLevel value="modern" match="localeDisplayNames/languages/language[@type='%language80']"/>  
    429                 <coverageLevel value="modern" match="localeDisplayNames/languages/language[@type='%language80'][@alt='%anyVariant']"/>  
     430                <coverageLevel value="modern" match="localeDisplayNames/languages/language[@type='%language80'][@alt='%anyAlphaNum']"/>  
    430431                <coverageLevel value="modern" match="localeDisplayNames/scripts/script[@type='%script80']"/> 
    431432                <coverageLevel value="modern" match="localeDisplayNames/territories/territory[@type='%territory80']"/> 
     
    512513                                 
    513514                <coverageLevel value="modern" match="listPatterns/listPattern[@type='(duration|unit)(-(short|narrow))?']/listPatternPart[@type='(2|start|middle|end)']"/> 
    514                 <coverageLevel value="modern" match="dates/calendars/calendar[@type='gregorian']/dayPeriods/dayPeriodContext[@type='format']/dayPeriodWidth[@type='%allWidths']/dayPeriod[@type='%ampmTypes']"/> 
     515                <coverageLevel value="modern" match="dates/calendars/calendar[@type='gregorian']/dayPeriods/dayPeriodContext[@type='%anyAlphaNum']/dayPeriodWidth[@type='%allWidths']/dayPeriod[@type='%anyAlphaNum']"/> 
    515516                <coverageLevel value="modern" match="localeDisplayNames/types/type[@type='%calendarType80'][@key='calendar']"/> 
    516517                <coverageLevel value="modern" match="dates/calendars/calendar[@type='gregorian']/eras/eraNames/era[@type='(0|1)']"/> 
    517518                <coverageLevel value="modern" match="dates/calendars/calendar[@type='gregorian']/eras/eraNames/era[@type='(0|1)'][@alt='variant']"/> 
    518519 
     520                <!--  
    519521                <coverageLevel value="comprehensive" match="units/unitLength[@type='narrow']/unit[@type='%unitsNonEnglish']/unitPattern[@count='${Target-Plurals}']"/> 
    520522                <coverageLevel value="comprehensive" match="dates/calendars/calendar[@type='gregorian']/eras/eraNarrow/era[@type='(0|1)']"/> 
     
    578580                <coverageLevel value="comprehensive" match="units/unitLength[@type='%unitLengths']/unit[@type='%unitsEnglish']/displayName"/> 
    579581                <coverageLevel value="comprehensive" match="units/unitLength[@type='%unitLengths']/unit[@type='%unitsEnglish']/perUnitPattern"/> 
     582                 --> 
    580583        </coverageLevels> 
    581584</supplementalData> 
  • trunk/tools/cldr-apps/src/org/unicode/cldr/web/DataSection.java

    r11358 r11554  
    25622562 
    25632563        //SupplementalDataInfo sdi = sm.getSupplementalDataInfo(); 
    2564         int workingCoverageValue = Level.valueOf(workingCoverageLevel.toUpperCase()).getLevel(); 
     2564        int workingCoverageValue = Level.fromString(workingCoverageLevel).getLevel(); 
    25652565        if (sectionId == SectionId.Timezones || pageId == PageId.Timezone_Display_Patterns 
    25662566            || (pageId == null && xpathPrefix.startsWith("//ldml/" + "dates/timeZoneNames"))) { 
     
    28252825        } 
    28262826 
    2827         int workingCoverageValue = Level.valueOf(workingCoverageLevel.toUpperCase()).getLevel(); 
     2827        int workingCoverageValue = Level.fromString(workingCoverageLevel).getLevel(); 
    28282828 
    28292829        //        CLDRFile vettedParent = null; 
  • trunk/tools/cldr-apps/src/org/unicode/cldr/web/UserRegistry.java

    r11358 r11554  
    24272427                            String org = attrs.get("org"); 
    24282428                            String email = normalizeEmail(attrs.get("email")); 
    2429                             Level level = Level.valueOf(attrs.get("level")); 
     2429                            Level level = Level.fromString(attrs.get("level")); 
    24302430                            String locales = attrs.get("locales"); 
    24312431 
  • trunk/tools/cldr-unittest/src/org/unicode/cldr/unittest/TestCLDRFile.java

    r11520 r11554  
    177177                        || path.contains("/relative[@type=\"-2\"]") 
    178178                        || path.contains("/relative[@type=\"2\"]") 
    179                         || path.startsWith("//ldml/characters/exemplarCharacters[@type=\"index\"]") 
    180                         && localeInfo.locale.equals("root") 
     179                        || path.startsWith("//ldml/contextTransforms/contextTransformUsage") 
     180                        || path.contains("[@alt=\"variant\"]") 
     181                        || (path.contains("dayPeriod[@type=")  
     182                            && (path.endsWith("1\"]") || path.endsWith("\"am\"]") || path.endsWith("\"pm\"]") || path.endsWith("\"midnight\"]") 
     183                            )) // morning1, afternoon1, ... 
     184                        || (path.startsWith("//ldml/characters/exemplarCharacters[@type=\"index\"]") 
     185                        && localeInfo.locale.equals("root")) 
    181186                    // //ldml/characters/exemplarCharacters[@type="index"][root] 
    182187                    ) { 
     
    186191                        + (englishInfo.cldrFile.isHere(path) ? "" : "*"); 
    187192                    missingPathsToLocales.put(path, localeAndStatus); 
     193                    // English contains the path, and the target locale doesn't. 
     194                    // The * means that the value is inherited (eg from root). 
    188195                } 
    189196            } 
     
    209216                        + (localeInfo.cldrFile.isHere(path) ? "" : "*"); 
    210217                    extraPathsToLocales.put(path, localeAndStatus); 
     218                    // English doesn't contains the path, and the target locale does. 
     219                    // The * means that the value is inherited (eg from root). 
    211220                } 
    212221            } 
     
    221230                path, status); 
    222231            String engName = "en" 
    223                 + (englishInfo.cldrFile.isHere(path) ? "" : "*" 
     232                + (englishInfo.cldrFile.isHere(path) ? "" : " (source_locale:" 
    224233                    + originalLocale 
    225                     + (path.equals(status.pathWhereFound) ? "" : "," 
    226                         + status) + ";"); 
     234                    + (path.equals(status.pathWhereFound) ? "" : ", source_path: " 
     235                        + status) + ")"); 
    227236            if (path.startsWith("//ldml/localeDisplayNames/") 
    228237                || path.contains("[@alt=\"accounting\"]")) { 
  • trunk/tools/cldr-unittest/src/org/unicode/cldr/unittest/TestCoverageLevel.java

    r11549 r11554  
    588588            } 
    589589            Level lvl = sdi.getCoverageLevel(path, "en"); 
    590             if (lvl == Level.OPTIONAL || lvl == Level.UNDETERMINED) { 
     590            if (lvl == Level.UNDETERMINED) { 
    591591                errln("Missing coverage value for path => " + path); 
    592592            } 
  • trunk/tools/cldr-unittest/src/org/unicode/cldr/unittest/TestCoverageLevel.txt

    r9320 r11554  
    1 ^//ldml/dates/calendars/calendar\[@type="(?!gregorian)[^"]*"] ; 101 
    2 ^//ldml/identity ; 101 
     1^//ldml/dates/calendars/calendar\[@type="(?!gregorian)[^"]*"] ; 100 
     2^//ldml/identity ; 100 
    33^//ldml/characters/exemplarCharacters\[@type="currencySymbol"] ; 30 
    44^//ldml/characters/exemplarCharacters ; 10 
    5 ^//ldml/.*/alias ; 101 
    6 ^//ldml/.*/default ; 101 
    7 ^//ldml/dates/calendars/calendar\[@type=".*"]/dateTimeFormats/appendItems/appendItem\[@request=".*"] ; 101 
    8 ^//ldml/dates/calendars/calendar\[@type=".*"]/dayPeriods/dayPeriodContext\[@type=".*"]/dayPeriodWidth\[@type="narrow"] ; 101 
    9 ^//ldml/dates/timeZoneNames/singleCountries ; 101 
    10 ^//ldml/references ; 101 
     5^//ldml/.*/alias ; 100 
     6^//ldml/.*/default ; 100 
     7^//ldml/dates/calendars/calendar\[@type=".*"]/dateTimeFormats/appendItems/appendItem\[@request=".*"] ; 100 
     8^//ldml/dates/calendars/calendar\[@type=".*"]/dayPeriods/dayPeriodContext\[@type=".*"]/dayPeriodWidth\[@type="narrow"] ; 100 
     9^//ldml/dates/timeZoneNames/singleCountries ; 100 
     10^//ldml/references ; 100 
    1111^//ldml/characters/ellipsis\[@type=".*"] ; 60 
    1212^//ldml/characters/moreInformation ; 60 
     
    1616^//ldml/dates/timeZoneNames/zone\[@type=".*"]/long/daylight ; 30 
    1717^//ldml/dates/timeZoneNames/zone\[@type=".*"]/short/daylight ; 30 
    18 ^//ldml/fallback ; 101 
     18^//ldml/fallback ; 100 
    1919^//ldml/layout/orientation ; 10 
    2020^//ldml/localeDisplayNames/transformNames/transformName\[@type=".*"] ; 60 
     
    2424^//ldml/numbers/decimalFormats/decimalFormatLength/decimalFormat\[@type=".*"]/pattern\[@type=".*"] ; 20 
    2525^//ldml/numbers/defaultNumberingSystem ; 20 
    26 ^//ldml/numbers/symbols/nativeZeroDigit ; 101 
    27 ^//ldml/numbers/symbols/patternDigit ; 101 
     26^//ldml/numbers/symbols/nativeZeroDigit ; 100 
     27^//ldml/numbers/symbols/patternDigit ; 100 
    2828 
    2929^//ldml/dates/calendars/calendar\[@type=".*"]/dateFormats/dateFormatLength\[@type="(long|short)"]/dateFormat\[@type=".*"]/pattern\[@type=".*"]; 20 
    3030^//ldml/dates/calendars/calendar\[@type=".*"]/dateTimeFormats/intervalFormats/intervalFormatItem\[@id=".*"]/greatestDifference\[@id=".*"] ; 40 
    31 ^//ldml/dates/calendars/calendar\[@type=".*"]/dayPeriods/dayPeriodContext\[@type=".*"]/dayPeriodWidth\[@type=".*"]/dayPeriod\[@type=".*"] ; 101 
     31^//ldml/dates/calendars/calendar\[@type=".*"]/dayPeriods/dayPeriodContext\[@type=".*"]/dayPeriodWidth\[@type=".*"]/dayPeriod\[@type=".*"] ; 100 
    3232^//ldml/dates/calendars/calendar\[@type=".*"]/eras/eraAbbr/era\[@type=".*"] ; 30 
    3333 
  • trunk/tools/cldr-unittest/src/org/unicode/cldr/unittest/TestPathHeader.java

    r11358 r11554  
    200200 
    201201    public void TestOptional() { 
     202        if (true) return; 
    202203        Map<PathHeader, String> sorted = new TreeMap<PathHeader, String>(); 
    203204        XPathParts parts = new XPathParts(); 
  • trunk/tools/java/org/unicode/cldr/tool/ShowData.java

    r11423 r11554  
    110110            String lastSourceDir = options[LAST_DIR].value; // Utility.COMMON_DIRECTORY 
    111111 
    112             Level requiredCoverage = Level.valueOf(options[COVERAGE].value.toUpperCase(Locale.ENGLISH)); // Utility.COMMON_DIRECTORY 
     112            Level requiredCoverage = Level.fromString(options[COVERAGE].toString()); // Utility.COMMON_DIRECTORY 
    113113 
    114114            if (options[GET_SCRIPTS].doesOccur) { 
  • trunk/tools/java/org/unicode/cldr/util/Level.java

    r7859 r11554  
    22 
    33import java.util.Locale; 
     4 
     5import com.ibm.icu.util.ULocale; 
    46 
    57/** 
     
    1214    UNDETERMINED(0, "none", 0), 
    1315    CORE(10, "G4", 100), 
    14     POSIX(20, "G4", 100), 
    15     MINIMAL(30, "G3.5", 90), 
     16    // POSIX(20, "G4", 100), 
     17    // MINIMAL(30, "G3.5", 90), 
    1618    BASIC(40, "G3", 80), 
    1719    MODERATE(60, "G2", 70), 
    1820    MODERN(80, "G1", 50), 
    19     COMPREHENSIVE(100, "G0", 2), 
    20     OPTIONAL(101, "optional", 1); 
     21    COMPREHENSIVE(100, "G0", 2); 
     22    //OPTIONAL(101, "optional", 1); 
     23     
     24    public static final Level POSIX = BASIC; 
     25    public static final Level MINIMAL = BASIC; 
     26    public static final Level OPTIONAL = COMPREHENSIVE; 
    2127 
    2228    private final byte level; 
    2329    private final String altName; 
    2430    private final int value; 
     31     
     32    private static final Level[] VALUES = values(); 
    2533 
    2634    /** 
     
    4351            return Level.valueOf(name.toUpperCase(Locale.ENGLISH)); 
    4452        } catch (RuntimeException e) { 
    45             for (Level level : Level.values()) { 
     53            for (Level level : VALUES) { 
    4654                if (name.equalsIgnoreCase(level.altName)) { 
    4755                    return level; 
    4856                } 
     57            } 
     58            if (name.equalsIgnoreCase("POSIX")) { 
     59                return POSIX; 
     60            } else if (name.equalsIgnoreCase("MINIMAL")) { 
     61                return MINIMAL; 
     62            } else if (name.equalsIgnoreCase("OPTIONAL")) { 
     63                return OPTIONAL; 
    4964            } 
    5065            return UNDETERMINED; 
     
    86101            } 
    87102        } 
     103 
     104        if (level == 20) { 
     105            return Level.POSIX; 
     106        } else if (level == 30) { 
     107            return Level.MINIMAL; 
     108        } else if (level == 101) { 
     109            return Level.OPTIONAL; 
     110        } 
    88111        throw new IllegalArgumentException(String.valueOf(level)); 
    89112    } 
     113     
     114    public static Level fromString(String source) { 
     115        return Level.get(source); 
     116    } 
    90117} 
  • trunk/tools/java/org/unicode/cldr/util/SupplementalDataInfo.java

    r11527 r11554  
    26182618                            String org = coverageLocaleParts[0]; 
    26192619                            String level = coverageLocaleParts[1].toUpperCase(); 
    2620                             Set<String> coverageLocales = sc.getLocaleCoverageLocales(org, EnumSet.of(Level.valueOf(level))); 
     2620                            Set<String> coverageLocales = sc.getLocaleCoverageLocales(org, EnumSet.of(Level.fromString(level))); 
    26212621                            for (String cl : coverageLocales) { 
    26222622                                localeList.add(CLDRLocale.getInstance(cl)); 
Note: See TracChangeset for help on using the changeset viewer.