• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.unicode.cldr.tool;
2 
3 import java.util.Set;
4 import java.util.TreeSet;
5 
6 import org.unicode.cldr.util.Annotations;
7 import org.unicode.cldr.util.Annotations.AnnotationSet;
8 import org.unicode.cldr.util.CLDRConfig;
9 
10 public class CheckAnnotations {
main(String[] args)11     public static void main(String[] args) {
12         AnnotationSet data = Annotations.getDataSet("en");
13         CLDRConfig config = CLDRConfig.getInstance();
14         //UnicodeMap<Annotations> data2 = Annotations.getData("de");
15         Set<String> sorted = new TreeSet<String>(config.getCollator());
16 
17         int i = 0;
18         boolean needMore = true;
19         for (int spaceCount = 1; needMore; ++spaceCount) {
20             needMore = false;
21             System.out.println("\nCOUNT: " + spaceCount);
22             for (String key : data.keySet().addAllTo(sorted)) {
23                 final String shortName = data.getShortName(key);
24                 String spaces = shortName.replaceAll("\\S", "");
25                 if (spaces.length() != spaceCount) {
26                     if (spaces.length() > spaceCount) {
27                         needMore = true;
28                     }
29                     continue;
30                 }
31                 System.out.println(++i + "\t" + key + "\t" + shortName + "\t" + data.getKeywords(key));
32             }
33         }
34     }
35 }
36