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

Changeset 11629


Ignore:
Timestamp:
05/14/15 10:31:52 (4 years ago)
Author:
emmons
Message:

cldrbug 7701: Fix for wide vs. abbreviated tests - not to compare vs. inheritance marker

Location:
trunk/tools/java/org/unicode/cldr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/java/org/unicode/cldr/test/CheckDates.java

    r11601 r11629  
    318318            if (path.indexOf("[@type=\"abbreviated\"]") >= 0) { 
    319319                String pathToWide = path.replace("[@type=\"abbreviated\"]", "[@type=\"wide\"]"); 
    320                 String wideValue = getCldrFileToCheck().getWinningValue(pathToWide); 
     320                String wideValue = getCldrFileToCheck().getWinningValueWithBailey(pathToWide); 
    321321                if (wideValue != null && isTooMuchWiderThan(value,wideValue)) { 
    322322                    CheckStatus item = new CheckStatus() 
     
    330330                boolean thisPathHasPeriod = value.contains("."); 
    331331                for (String lgPath : LogicalGrouping.getPaths(getCldrFileToCheck(), path)) { 
    332                     String lgPathValue = getCldrFileToCheck().getWinningValue(lgPath); 
     332                    String lgPathValue = getCldrFileToCheck().getWinningValueWithBailey(lgPath); 
    333333                    String lgPathToWide = lgPath.replace("[@type=\"abbreviated\"]", "[@type=\"wide\"]"); 
    334                     String lgPathWideValue = getCldrFileToCheck().getWinningValue(lgPathToWide); 
     334                    String lgPathWideValue = getCldrFileToCheck().getWinningValueWithBailey(lgPathToWide); 
    335335                    // This helps us get around things like "de març" vs. "març" in Catalan 
    336336                    if (wideValue != null && wideValue.lastIndexOf(" ") < 3) { 
     
    354354            } else if (path.indexOf("[@type=\"narrow\"]") >= 0) { 
    355355                String pathToAbbr = path.replace("[@type=\"narrow\"]", "[@type=\"abbreviated\"]"); 
    356                 String abbrValue = getCldrFileToCheck().getWinningValue(pathToAbbr); 
     356                String abbrValue = getCldrFileToCheck().getWinningValueWithBailey(pathToAbbr); 
    357357                if (abbrValue != null && isTooMuchWiderThan(value,abbrValue)) { 
    358358                    CheckStatus item = new CheckStatus() 
     
    366366            } else if (path.indexOf("/eraNarrow") >= 0) { 
    367367                String pathToAbbr = path.replace("/eraNarrow", "/eraAbbr"); 
    368                 String abbrValue = getCldrFileToCheck().getWinningValue(pathToAbbr); 
     368                String abbrValue = getCldrFileToCheck().getWinningValueWithBailey(pathToAbbr); 
    369369                if (abbrValue != null && isTooMuchWiderThan(value,abbrValue)) { 
    370370                    CheckStatus item = new CheckStatus() 
     
    378378            } else if (path.indexOf("/eraAbbr") >= 0) { 
    379379                String pathToWide = path.replace("/eraAbbr", "/eraNames"); 
    380                 String wideValue = getCldrFileToCheck().getWinningValue(pathToWide); 
     380                String wideValue = getCldrFileToCheck().getWinningValueWithBailey(pathToWide); 
    381381                if (wideValue != null && isTooMuchWiderThan(value,wideValue)) { 
    382382                    CheckStatus item = new CheckStatus() 
  • trunk/tools/java/org/unicode/cldr/util/CLDRFile.java

    r11560 r11629  
    29482948        return winningPath == null ? null : getStringValue(winningPath); 
    29492949    } 
     2950    /** 
     2951     * Shortcut for getting the string value for the winning path. 
     2952     * If the winning value is an INHERITANCE_MARKER (used in survey 
     2953     * tool), then the Bailey value is returned. 
     2954     *  
     2955     * @param path 
     2956     * @return 
     2957     */ 
     2958    public String getWinningValueWithBailey(String path) { 
     2959        String winningValue = getWinningValue(path); 
     2960        if (CldrUtility.INHERITANCE_MARKER.equals(winningValue)) { 
     2961            winningValue = getBaileyValue(path,null,null); 
     2962        } 
     2963        return winningValue; 
     2964    } 
    29502965 
    29512966    /** 
Note: See TracChangeset for help on using the changeset viewer.