Home | History | Annotate | Download | only in util
      1 package org.unicode.cldr.util;
      2 
      3 import java.util.Collections;
      4 import java.util.EnumMap;
      5 import java.util.LinkedHashMap;
      6 import java.util.Map;
      7 import java.util.Set;
      8 
      9 import com.ibm.icu.util.ULocale;
     10 
     11 /**
     12  * This is a first-cut version just to get going. The data is hard coded until we switch over to real data in ICU.
     13  */
     14 public class DayPeriodsOld {
     15     private static final int HOUR = 60 * 60 * 1000;
     16 
     17     public enum DayPeriod {
     18         MORNING1("EARLY_MORNING"), MORNING2("MORNING"), AFTERNOON1("EARLY_AFTERNOON"), AFTERNOON2("AFTERNOON"), EVENING1("EARLY_EVENING"), EVENING2(
     19             "EVENING"), NIGHT1("NIGHT"), NIGHT2("LATE_NIGHT");
     20         public final String name;
     21 
     22         DayPeriod(String name) {
     23             this.name = name;
     24         }
     25 
     26         public static DayPeriod get(String dayPeriod) {
     27             for (DayPeriod d : DayPeriod.values()) {
     28                 if (dayPeriod.equals(d.name)) {
     29                     return d;
     30                 }
     31             }
     32             return DayPeriod.valueOf(dayPeriod);
     33         }
     34     }
     35 
     36     /**
     37      * Get the category for a given time in the day.
     38      * @param millisInDay
     39      * @return
     40      */
     41     public DayPeriod get(long millisInDay) {
     42         long hours = millisInDay / HOUR;
     43         int hoursInDay = (int) (hours % 24);
     44         if (hoursInDay < 0) {
     45             hoursInDay += 24;
     46         }
     47         return timeMap[hoursInDay];
     48     }
     49 
     50     /**
     51      * Get the *actual* locale for the DayPeriods (eg, asking for "en-AU" may get you "en")
     52      * @param millisInDay
     53      * @return
     54      */
     55     public ULocale getLocale() {
     56         return locale;
     57     }
     58 
     59     /**
     60      * Get a sample, for showing to a localizer. The actual phrase should come out of a SELECT statement, since it may vary by message.
     61      * @param millisInDay
     62      * @return
     63      */
     64     public String getSample(DayPeriod dayPeriod) {
     65         return samples.get(dayPeriod);
     66     }
     67 
     68     /**
     69      * Return the possible DayPeriod values for this locale.
     70      * @return
     71      */
     72     public Set<DayPeriod> getDayPeriods() {
     73         return samples.keySet();
     74     }
     75 
     76     /**
     77      * Get an instance with a factory method. Right now, returns null if the locale data is not available.
     78      * @param loc
     79      * @return
     80      */
     81     public static DayPeriodsOld getInstance(ULocale loc) {
     82         ULocale base = new ULocale(loc.getLanguage());
     83         DayPeriodsOld result = DATA.get(base);
     84 //        if (result == null) {
     85 //            throw new IllegalArgumentException("No data for locale " + loc);
     86 //        }
     87         return result;
     88     }
     89 
     90     /**
     91      * Returns the available locales. Note that regional/script variants may be mapped by getInstance to a base locale,
     92      * eg, en-AU => en.
     93      * @return
     94      */
     95     public static Set<ULocale> getAvailable() {
     96         return DATA.keySet();
     97     }
     98 
     99     // ===== PRIVATES =====
    100 
    101     private final ULocale locale;
    102     private final DayPeriod[] timeMap;
    103     private final Map<DayPeriod, String> samples;
    104 
    105     private DayPeriodsOld(ULocale base, DayPeriod[] map, EnumMap<DayPeriod, String> samples2) {
    106         locale = base;
    107         fix(map, samples2, DayPeriod.MORNING2, DayPeriod.MORNING1);
    108         fix(map, samples2, DayPeriod.AFTERNOON2, DayPeriod.AFTERNOON1);
    109         fix(map, samples2, DayPeriod.EVENING2, DayPeriod.EVENING1);
    110         fix(map, samples2, DayPeriod.NIGHT2, DayPeriod.NIGHT1);
    111         timeMap = map;
    112         samples = Collections.unmodifiableMap(samples2);
    113     }
    114 
    115     private void fix(DayPeriod[] map, EnumMap<DayPeriod, String> samples2, DayPeriod dayPeriod2, DayPeriod dayPeriod1) {
    116         if (samples2.containsKey(dayPeriod2) && !samples2.containsKey(dayPeriod1)) {
    117             samples2.put(dayPeriod1, samples2.get(dayPeriod2));
    118             samples2.remove(dayPeriod2);
    119             for (int i = 0; i < map.length; ++i) {
    120                 if (map[i] == dayPeriod2) {
    121                     map[i] = dayPeriod1;
    122                 }
    123             }
    124         }
    125     }
    126 
    127     // HACK TO SET UP DATA
    128     // Will be replaced by real data table in the future
    129 
    130     private static final Map<ULocale, DayPeriodsOld> DATA = new LinkedHashMap<>();
    131 
    132     private static DayPeriodBuilder make(String locale) {
    133         return new DayPeriodBuilder(locale);
    134     }
    135 
    136     private static class DayPeriodBuilder {
    137         private final ULocale locale;
    138         private final DayPeriod[] timeMap = new DayPeriod[24];
    139         private final EnumMap<DayPeriod, String> samples = new EnumMap<>(DayPeriod.class);
    140 
    141         DayPeriodBuilder(String locale) {
    142             this.locale = new ULocale(locale);
    143         }
    144 
    145         public DayPeriodBuilder add(String dayPeriod, String localeName, int... hours) {
    146             DayPeriod dayPeriodEnum = DayPeriod.get(dayPeriod);
    147             String previous = samples.put(dayPeriodEnum, localeName);
    148             if (previous != null) {
    149                 throw new IllegalArgumentException(locale + " Collision");
    150             }
    151             for (int i : hours) {
    152                 if (timeMap[i] != null) {
    153                     throw new IllegalArgumentException(locale + " Collision " + i + ", " + timeMap[i] + ", " + dayPeriodEnum);
    154                 }
    155                 timeMap[i] = dayPeriodEnum;
    156             }
    157             return this;
    158         }
    159 
    160         public DayPeriodsOld build() {
    161             for (int i = 0; i < timeMap.length; ++i) {
    162                 DayPeriod dp = timeMap[i];
    163                 if (dp == null) {
    164                     throw new IllegalArgumentException(locale + " Missing item: " + i);
    165                 }
    166             }
    167             DayPeriodsOld item = new DayPeriodsOld(locale, timeMap, samples);
    168             DATA.put(locale, item);
    169             return item;
    170         }
    171     }
    172 
    173     static {
    174         make("en")
    175             .add("NIGHT1", "night", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    176             .add("MORNING1", "morning", 6, 7, 8, 9, 10, 11)
    177             .add("AFTERNOON1", "afternoon", 12, 13, 14, 15, 16, 17)
    178             .add("EVENING1", "evening", 18, 19, 20)
    179             .build();
    180 
    181         make("af")
    182             .add("MORNING", "oggend", 5, 6, 7, 8, 9, 10, 11)
    183             .add("AFTERNOON", "middag", 12, 13, 14, 15, 16, 17)
    184             .add("EVENING", "aand", 18, 19, 20, 21, 22, 23)
    185             .add("NIGHT", "nag", 0, 1, 2, 3, 4)
    186             .build();
    187 
    188         make("nl")
    189             .add("MORNING", "ochtend", 6, 7, 8, 9, 10, 11)
    190             .add("AFTERNOON", "middag", 12, 13, 14, 15, 16, 17)
    191             .add("EVENING", "avond", 18, 19, 20, 21, 22, 23)
    192             .add("NIGHT", "nacht", 0, 1, 2, 3, 4, 5)
    193             .build();
    194 
    195         make("de")
    196             .add("EARLY_MORNING", "Morgen", 5, 6, 7, 8, 9)
    197             .add("MORNING", "Vormittag", 10, 11)
    198             .add("AFTERNOON", "Mittag", 12)
    199             .add("EVENING", "Nachmittag", 13, 14, 15, 16, 17)
    200             .add("NIGHT", "Abend", 18, 19, 20, 21, 22, 23)
    201             .add("LATE_NIGHT", "Nacht", 0, 1, 2, 3, 4)
    202             .build();
    203 
    204         make("da")
    205             .add("EARLY_MORNING", "morgen", 5, 6, 7, 8, 9)
    206             .add("MORNING", "formiddag", 10, 11)
    207             .add("AFTERNOON", "eftermiddag", 12, 13, 14, 15, 16, 17)
    208             .add("EVENING", "aften", 18, 19, 20, 21, 22, 23)
    209             .add("NIGHT", "nat", 0, 1, 2, 3, 4)
    210             .build();
    211 
    212         make("nb")
    213             .add("EARLY_MORNING", "morgen", 6, 7, 8, 9)
    214             .add("MORNING", "formiddag", 10, 11)
    215             .add("AFTERNOON", "ettermiddag", 12, 13, 14, 15, 16, 17)
    216             .add("EVENING", "kveld", 18, 19, 20, 21, 22, 23)
    217             .add("NIGHT", "natt", 0, 1, 2, 3, 4, 5)
    218             .build();
    219 
    220         make("sv")
    221             .add("EARLY_MORNING", "morgon", 5, 6, 7, 8, 9)
    222             .add("MORNING", "frmiddag", 10, 11)
    223             .add("AFTERNOON", "eftermiddag", 12, 13, 14, 15, 16, 17)
    224             .add("EVENING", "kvll", 18, 19, 20, 21, 22, 23)
    225             .add("NIGHT", "natt", 0, 1, 2, 3, 4)
    226             .build();
    227 
    228         make("is")
    229             .add("MORNING", "morgunn", 6, 7, 8, 9, 10, 11)
    230             .add("AFTERNOON", "eftir hdegi", 12, 13, 14, 15, 16, 17)
    231             .add("EVENING", "kvld", 18, 19, 20, 21, 22, 23)
    232             .add("NIGHT", "ntt", 0, 1, 2, 3, 4, 5)
    233             .build();
    234 
    235         make("pt")
    236             .add("MORNING", "manh", 6, 7, 8, 9, 10, 11)
    237             .add("AFTERNOON", "tarde", 12, 13, 14, 15, 16, 17, 18)
    238             .add("EVENING", "noite", 19, 20, 21, 22, 23)
    239             .add("NIGHT", "madrugada", 0, 1, 2, 3, 4, 5)
    240             .build();
    241 
    242         make("gl")
    243             .add("EARLY_MORNING", "madrugada", 0, 1, 2, 3, 4, 5)
    244             .add("MORNING", "ma", 6, 7, 8, 9, 10, 11)
    245             .add("AFTERNOON", "medioda", 12)
    246             .add("EVENING", "tarde", 13, 14, 15, 16, 17, 18, 19, 20)
    247             .add("NIGHT", "noite", 21, 22, 23)
    248             .build();
    249 
    250         make("es")
    251             .add("MORNING", "maana", 6, 7, 8, 9, 10, 11)
    252             .add("AFTERNOON", "tarde", 12, 13, 14, 15, 16, 17, 18, 19)
    253             .add("EVENING", "noche", 20, 21, 22, 23)
    254             .add("NIGHT", "madrugada", 0, 1, 2, 3, 4, 5)
    255             .build();
    256 
    257         make("ca")
    258             .add("EARLY_MORNING", "matinada", 0, 1, 2, 3, 4, 5)
    259             .add("MORNING", "mat", 6, 7, 8, 9, 10, 11)
    260             .add("EARLY_AFTERNOON", "migdia", 12)
    261             .add("AFTERNOON", "tarda", 13, 14, 15, 16, 17, 18)
    262             .add("EVENING", "vespre", 19, 20)
    263             .add("NIGHT", "nit", 21, 22, 23)
    264             .build();
    265 
    266         make("it")
    267             .add("MORNING", "mattina", 6, 7, 8, 9, 10, 11)
    268             .add("AFTERNOON", "pomeriggio", 12, 13, 14, 15, 16, 17)
    269             .add("EVENING", "sera", 18, 19, 20, 21, 22, 23)
    270             .add("NIGHT", "notte", 0, 1, 2, 3, 4, 5)
    271             .build();
    272 
    273         make("ro")
    274             .add("MORNING", "diminea", 5, 6, 7, 8, 9, 10, 11)
    275             .add("AFTERNOON", "dup-amiaz", 12, 13, 14, 15, 16, 17)
    276             .add("EVENING", "sear", 18, 19, 20, 21)
    277             .add("NIGHT", "noapte", 0, 1, 2, 3, 4, 22, 23)
    278             .build();
    279 
    280         make("fr")
    281             .add("MORNING", "matin", 4, 5, 6, 7, 8, 9, 10, 11)
    282             .add("AFTERNOON", "aprs-midi", 12, 13, 14, 15, 16, 17)
    283             .add("EVENING", "soir", 18, 19, 20, 21, 22, 23)
    284             .add("NIGHT", "nuit", 0, 1, 2, 3)
    285             .build();
    286 
    287         make("hr")
    288             .add("MORNING", "jutro", 4, 5, 6, 7, 8, 9, 10, 11)
    289             .add("AFTERNOON", "popodne", 12, 13, 14, 15, 16, 17)
    290             .add("EVENING", "veer", 18, 19, 20)
    291             .add("NIGHT", "no", 0, 1, 2, 3, 21, 22, 23)
    292             .build();
    293 
    294         make("bs")
    295             .add("MORNING", "jutro", 4, 5, 6, 7, 8, 9, 10, 11)
    296             .add("AFTERNOON", "popodne", 12, 13, 14, 15, 16, 17)
    297             .add("EVENING", "vee", 18, 19, 20)
    298             .add("NIGHT", "no", 0, 1, 2, 3, 21, 22, 23)
    299             .build();
    300 
    301         make("sr")
    302             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    303             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    304             .add("EVENING", "", 18, 19, 20)
    305             .add("NIGHT", "", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    306             .build();
    307 
    308         make("sl")
    309             .add("EARLY_MORNING", "jutro", 6, 7, 8, 9)
    310             .add("MORNING", "dopoldne", 10, 11)
    311             .add("AFTERNOON", "popoldne", 12, 13, 14, 15, 16, 17)
    312             .add("EVENING", "veer", 18, 19, 20, 21)
    313             .add("NIGHT", "no", 0, 1, 2, 3, 4, 5, 22, 23)
    314             .build();
    315 
    316         make("cs")
    317             .add("EARLY_MORNING", "rno", 4, 5, 6, 7, 8)
    318             .add("MORNING", "dopoledne", 9, 10, 11)
    319             .add("AFTERNOON", "odpoledne", 12, 13, 14, 15, 16, 17)
    320             .add("EVENING", "veer", 18, 19, 20, 21)
    321             .add("NIGHT", "noc", 0, 1, 2, 3, 22, 23)
    322             .build();
    323 
    324         make("sk")
    325             .add("EARLY_MORNING", "rno", 4, 5, 6, 7, 8)
    326             .add("MORNING", "dopoludnie", 9, 10, 11)
    327             .add("AFTERNOON", "popoludnie", 12, 13, 14, 15, 16, 17)
    328             .add("EVENING", "veer", 18, 19, 20, 21)
    329             .add("NIGHT", "noc", 0, 1, 2, 3, 22, 23)
    330             .build();
    331 
    332         make("pl")
    333             .add("EARLY_MORNING", "rano", 6, 7, 8, 9)
    334             .add("MORNING", "przedpoudnie", 10, 11)
    335             .add("AFTERNOON", "popoudnie", 12, 13, 14, 15, 16, 17)
    336             .add("EVENING", "wieczr", 18, 19, 20)
    337             .add("NIGHT", "noc", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    338             .build();
    339 
    340         make("bg")
    341             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10)
    342             .add("EARLY_AFTERNOON", " ", 11, 12, 13)
    343             .add("AFTERNOON", "", 14, 15, 16, 17)
    344             .add("EVENING", "", 18, 19, 20, 21)
    345             .add("NIGHT", "", 0, 1, 2, 3, 22, 23)
    346             .build();
    347 
    348         make("mk")
    349             .add("EARLY_MORNING", "", 4, 5, 6, 7, 8, 9)
    350             .add("MORNING", "", 10, 11)
    351             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    352             .add("EVENING", "", 18, 19, 20, 21, 22, 23)
    353             .add("NIGHT", " ", 0, 1, 2, 3)
    354             .build();
    355 
    356         make("ru")
    357             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10, 11)
    358             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    359             .add("EVENING", "", 18, 19, 20, 21, 22, 23)
    360             .add("NIGHT", "", 0, 1, 2, 3)
    361             .build();
    362 
    363         make("uk")
    364             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10, 11)
    365             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    366             .add("EVENING", "", 18, 19, 20, 21, 22, 23)
    367             .add("NIGHT", "", 0, 1, 2, 3)
    368             .build();
    369 
    370         make("lt")
    371             .add("MORNING", "rytas", 6, 7, 8, 9, 10, 11)
    372             .add("AFTERNOON", "diena", 12, 13, 14, 15, 16, 17)
    373             .add("EVENING", "vakaras", 18, 19, 20, 21, 22, 23)
    374             .add("NIGHT", "naktis", 0, 1, 2, 3, 4, 5)
    375             .build();
    376 
    377         make("lv")
    378             .add("MORNING", "rts", 6, 7, 8, 9, 10, 11)
    379             .add("AFTERNOON", "pcpusdiena", 12, 13, 14, 15, 16, 17)
    380             .add("EVENING", "vakars", 18, 19, 20, 21, 22)
    381             .add("NIGHT", "nakts", 0, 1, 2, 3, 4, 5, 23)
    382             .build();
    383 
    384         make("el")
    385             .add("EARLY_MORNING", "", 0)
    386             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10, 11)
    387             .add("AFTERNOON", "", 12, 13, 14, 15, 16)
    388             .add("EVENING", "", 17, 18, 19)
    389             .add("NIGHT", "", 1, 2, 3, 20, 21, 22, 23)
    390             .build();
    391 
    392         make("fa")
    393             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10, 11)
    394             .add("AFTERNOON", "  ", 12, 13, 14, 15, 16)
    395             .add("EVENING", "", 17, 18)
    396             .add("NIGHT", "", 0, 1, 2, 3, 19, 20, 21, 22, 23)
    397             .build();
    398 
    399         make("hy")
    400             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    401             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    402             .add("EVENING", "", 18, 19, 20, 21, 22, 23)
    403             .add("NIGHT", "", 0, 1, 2, 3, 4, 5)
    404             .build();
    405 
    406         make("ka")
    407             .add("MORNING", "", 5, 6, 7, 8, 9, 10, 11)
    408             .add("EARLY_AFTERNOON", " ", 12, 13, 14, 15, 16)
    409             .add("AFTERNOON", " ", 17)
    410             .add("EVENING", "", 18, 19, 20)
    411             .add("NIGHT", "", 0, 1, 2, 3, 4, 21, 22, 23)
    412             .build();
    413 
    414         make("sq")
    415             .add("EARLY_MORNING", "mngjes", 4, 5, 6, 7, 8)
    416             .add("MORNING", "paradite", 9, 10, 11)
    417             .add("AFTERNOON", "pasdite", 12, 13, 14, 15, 16, 17)
    418             .add("EVENING", "mbrmje", 18, 19, 20, 21, 22, 23)
    419             .add("NIGHT", "nat", 0, 1, 2, 3)
    420             .build();
    421 
    422         make("ur")
    423             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10, 11)
    424             .add("EARLY_AFTERNOON", "", 12, 13, 14, 15)
    425             .add("AFTERNOON", " ", 16, 17)
    426             .add("EVENING", "", 18, 19)
    427             .add("NIGHT", "", 0, 1, 2, 3, 20, 21, 22, 23)
    428             .build();
    429 
    430         make("hi")
    431             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10, 11)
    432             .add("AFTERNOON", "", 12, 13, 14, 15)
    433             .add("EVENING", "", 16, 17, 18, 19)
    434             .add("NIGHT", "", 0, 1, 2, 3, 20, 21, 22, 23)
    435             .build();
    436 
    437         make("bn")
    438             .add("EARLY_MORNING", "", 4, 5)
    439             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    440             .add("EARLY_AFTERNOON", "", 12, 13, 14, 15)
    441             .add("AFTERNOON", "", 16, 17)
    442             .add("EVENING", "", 18, 19)
    443             .add("NIGHT", "", 0, 1, 2, 3, 20, 21, 22, 23)
    444             .build();
    445 
    446         make("gu")
    447             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10, 11)
    448             .add("AFTERNOON", "", 12, 13, 14, 15)
    449             .add("EVENING", "", 16, 17, 18, 19)
    450             .add("NIGHT", "", 0, 1, 2, 3, 20, 21, 22, 23)
    451             .build();
    452 
    453         make("mr")
    454             .add("EARLY_MORNING", "", 4, 5)
    455             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    456             .add("AFTERNOON", "", 12, 13, 14, 15)
    457             .add("EVENING", "", 16, 17, 18, 19)
    458             .add("NIGHT", "", 0, 1, 2, 20, 21, 22, 23)
    459             .add("LATE_NIGHT", "", 3)
    460             .build();
    461 
    462         make("ne")
    463             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10, 11)
    464             .add("EARLY_AFTERNOON", "", 12, 13, 14, 15)
    465             .add("AFTERNOON", "", 16, 17, 18)
    466             .add("EVENING", "", 19, 20, 21)
    467             .add("NIGHT", "", 0, 1, 2, 3, 22, 23)
    468             .build();
    469 
    470         make("pa")
    471             .add("MORNING", "", 4, 5, 6, 7, 8, 9, 10, 11)
    472             .add("AFTERNOON", "", 12, 13, 14, 15)
    473             .add("EVENING", "", 16, 17, 18, 19, 20)
    474             .add("NIGHT", "", 0, 1, 2, 3, 21, 22, 23)
    475             .build();
    476 
    477         make("si")
    478             .add("EARLY_MORNING", "", 1, 2, 3, 4, 5)
    479             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    480             .add("AFTERNOON", "", 12, 13)
    481             .add("EVENING", "", 14, 15, 16, 17)
    482             .add("NIGHT", "", 18, 19, 20, 21, 22, 23)
    483             .add("LATE_NIGHT", " ", 0)
    484             .build();
    485 
    486         make("ta")
    487             .add("EARLY_MORNING", "", 3, 4)
    488             .add("MORNING", "", 5, 6, 7, 8, 9, 10, 11)
    489             .add("AFTERNOON", "", 12, 13, 16, 17)
    490             .add("EVENING", "", 14, 15, 18, 19, 20)
    491             .add("NIGHT", "", 0, 1, 2, 21, 22, 23)
    492             .build();
    493 
    494         make("te")
    495             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    496             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    497             .add("EVENING", "", 18, 19, 20)
    498             .add("NIGHT", "", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    499             .build();
    500 
    501         make("ml")
    502             .add("EARLY_MORNING", "", 3, 4, 5)
    503             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    504             .add("EARLY_AFTERNOON", "", 12, 13)
    505             .add("AFTERNOON", "", 14)
    506             .add("EARLY_EVENING", "", 15, 16, 17)
    507             .add("EVENING", "", 18)
    508             .add("NIGHT", "", 0, 1, 2, 19, 20, 21, 22, 23)
    509             .build();
    510 
    511         make("kn")
    512             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    513             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    514             .add("EVENING", "", 18, 19, 20)
    515             .add("NIGHT", "", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    516             .build();
    517 
    518         make("zh")
    519             .add("EARLY_MORNING", "", 5, 6, 7)
    520             .add("MORNING", "", 8, 9, 10, 11)
    521             .add("AFTERNOON", "", 12)
    522             .add("EVENING", "", 13, 14, 15, 16, 17, 18)
    523             .add("NIGHT", "", 19, 20, 21, 22, 23)
    524             .add("LATE_NIGHT", "", 0, 1, 2, 3, 4)
    525             .build();
    526 
    527         make("ja")
    528             .add("EARLY_MORNING", "", 6, 7, 8)
    529             .add("MORNING", "", 9, 10, 11)
    530             .add("EARLY_AFTERNOON", "", 12, 13, 14, 15)
    531             .add("AFTERNOON", "", 16, 17, 18)
    532             .add("EVENING", "", 19, 20, 21, 22)
    533             .add("NIGHT", "", 0, 1, 2, 3, 23)
    534             .add("LATE_NIGHT", "", 4, 5)
    535             .build();
    536 
    537         make("ko")
    538             .add("EARLY_MORNING", "", 3, 4, 5)
    539             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    540             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    541             .add("EVENING", "", 18, 19, 20)
    542             .add("NIGHT", "", 0, 1, 2, 21, 22, 23)
    543             .build();
    544 
    545         make("tr")
    546             .add("EARLY_MORNING", "sabah", 6, 7, 8, 9, 10)
    547             .add("MORNING", "leden nce", 11)
    548             .add("EARLY_AFTERNOON", "leden sonra", 12, 13, 14, 15, 16, 17)
    549             .add("AFTERNOON", "akamst", 18)
    550             .add("EVENING", "akam", 19, 20)
    551             .add("NIGHT", "gece", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    552             .build();
    553 
    554         make("az")
    555             .add("EARLY_MORNING", "sbh", 4, 5)
    556             .add("MORNING", "shr", 6, 7, 8, 9, 10, 11)
    557             .add("AFTERNOON", "gndz", 12, 13, 14, 15, 16)
    558             .add("EVENING", "axamst", 17, 18)
    559             .add("NIGHT", "axam", 19, 20, 21, 22, 23)
    560             .add("LATE_NIGHT", "gec", 0, 1, 2, 3)
    561             .build();
    562 
    563         make("kk")
    564             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    565             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    566             .add("EVENING", "", 18, 19, 20)
    567             .add("NIGHT", "", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    568             .build();
    569 
    570         make("ky")
    571             .add("MORNING", " ", 6, 7, 8, 9, 10, 11)
    572             .add("AFTERNOON", " ", 12, 13, 14, 15, 16, 17)
    573             .add("EVENING", "", 18, 19, 20)
    574             .add("NIGHT", "", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    575             .build();
    576 
    577         make("uz")
    578             .add("MORNING", "ertalab", 6, 7, 8, 9, 10)
    579             .add("AFTERNOON", "kunduz", 11, 12, 13, 14, 15, 16, 17)
    580             .add("EVENING", "kechqurun", 18, 19, 20, 21)
    581             .add("NIGHT", "tun", 0, 1, 2, 3, 4, 5, 22, 23)
    582             .build();
    583 
    584         make("et")
    585             .add("MORNING", "hommik", 5, 6, 7, 8, 9, 10, 11)
    586             .add("AFTERNOON", "prastluna", 12, 13, 14, 15, 16, 17)
    587             .add("EVENING", "htu", 18, 19, 20, 21, 22)
    588             .add("NIGHT", "", 0, 1, 2, 3, 4, 23)
    589             .build();
    590 
    591         make("fi")
    592             .add("EARLY_MORNING", "aamu", 5, 6, 7, 8, 9)
    593             .add("MORNING", "aamupiv", 10, 11)
    594             .add("AFTERNOON", "iltapiv", 12, 13, 14, 15, 16, 17)
    595             .add("EVENING", "ilta", 18, 19, 20, 21, 22)
    596             .add("NIGHT", "y", 0, 1, 2, 3, 4, 23)
    597             .build();
    598 
    599         make("hu")
    600             .add("EARLY_MORNING", "reggel", 6, 7, 8)
    601             .add("MORNING", "dleltt", 9, 10, 11)
    602             .add("AFTERNOON", "dlutn", 12, 13, 14, 15, 16, 17)
    603             .add("EVENING", "este", 18, 19, 20)
    604             .add("NIGHT", "jjel", 0, 1, 2, 3, 21, 22, 23)
    605             .add("LATE_NIGHT", "hajnal", 4, 5)
    606             .build();
    607 
    608         make("th")
    609             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    610             .add("EARLY_AFTERNOON", "", 12)
    611             .add("AFTERNOON", "", 13, 14, 15)
    612             .add("EARLY_EVENING", "", 16, 17)
    613             .add("EVENING", "", 18, 19, 20)
    614             .add("NIGHT", "", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    615             .build();
    616 
    617         make("lo")
    618             .add("EARLY_MORNING", "", 0, 1, 2, 3, 4)
    619             .add("MORNING", "", 5, 6, 7, 8, 9, 10, 11)
    620             .add("EARLY_AFTERNOON", "", 12, 13, 14, 15)
    621             .add("AFTERNOON", "", 16)
    622             .add("EVENING", "", 17, 18, 19)
    623             .add("NIGHT", "", 20, 21, 22, 23)
    624             .build();
    625 
    626         make("ar")
    627             .add("EARLY_MORNING", "", 3, 4, 5)
    628             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    629             .add("EARLY_AFTERNOON", "", 12)
    630             .add("AFTERNOON", " ", 13, 14, 15, 16, 17)
    631             .add("EVENING", "", 18, 19, 20, 21, 22, 23)
    632             .add("NIGHT", "  ", 0)
    633             .add("LATE_NIGHT", "", 1, 2)
    634             .build();
    635 
    636         make("he")
    637             .add("MORNING", "", 5, 6, 7, 8, 9, 10)
    638             .add("EARLY_AFTERNOON", "", 11, 12, 13, 14)
    639             .add("AFTERNOON", " ", 15, 16, 17)
    640             .add("EVENING", "", 18, 19, 20, 21)
    641             .add("NIGHT", "", 0, 1, 2, 3, 4, 22, 23)
    642             .build();
    643 
    644         make("id")
    645             .add("MORNING", "pagi", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
    646             .add("AFTERNOON", "siang", 10, 11, 12, 13, 14)
    647             .add("EVENING", "sore", 15, 16, 17)
    648             .add("NIGHT", "malam", 18, 19, 20, 21, 22, 23)
    649             .build();
    650 
    651         make("ms")
    652             .add("EARLY_MORNING", "tengah malam", 0)
    653             .add("MORNING", "pagi", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
    654             .add("AFTERNOON", "tengah hari", 12, 13)
    655             .add("EVENING", "petang", 14, 15, 16, 17, 18)
    656             .add("NIGHT", "malam", 19, 20, 21, 22, 23)
    657             .build();
    658 
    659         make("fil")
    660             .add("EARLY_MORNING", "madaling-araw", 0, 1, 2, 3, 4, 5)
    661             .add("MORNING", "umaga", 6, 7, 8, 9, 10, 11)
    662             .add("AFTERNOON", "tanghali", 12, 13, 14, 15)
    663             .add("EVENING", "hapon", 16, 17)
    664             .add("NIGHT", "gabi", 18, 19, 20, 21, 22, 23)
    665             .build();
    666 
    667         make("vi")
    668             .add("MORNING", "sng", 4, 5, 6, 7, 8, 9, 10, 11)
    669             .add("AFTERNOON", "chiu", 12, 13, 14, 15, 16, 17)
    670             .add("EVENING", "ti", 18, 19, 20)
    671             .add("NIGHT", "m", 0, 1, 2, 3, 21, 22, 23)
    672             .build();
    673 
    674         make("km")
    675             .add("MORNING", "", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
    676             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    677             .add("EVENING", "", 18, 19, 20)
    678             .add("NIGHT", "", 21, 22, 23)
    679             .build();
    680 
    681         make("sw")
    682             .add("EARLY_MORNING", "alfajiri", 4, 5, 6)
    683             .add("MORNING", "asubuhi", 7, 8, 9, 10, 11)
    684             .add("AFTERNOON", "mchana", 12, 13, 14, 15)
    685             .add("EVENING", "jioni", 16, 17, 18)
    686             .add("NIGHT", "usiku", 0, 1, 2, 3, 19, 20, 21, 22, 23)
    687             .build();
    688 
    689         make("zu")
    690             .add("EARLY_MORNING", "ntathakusa", 0, 1, 2, 3, 4, 5)
    691             .add("MORNING", "ekuseni", 6, 7, 8, 9)
    692             .add("AFTERNOON", "emini", 10, 11, 12)
    693             .add("EVENING", "ntambama", 13, 14, 15, 16, 17, 18)
    694             .add("NIGHT", "ebusuku", 19, 20, 21, 22, 23)
    695             .build();
    696 
    697         make("am")
    698             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    699             .add("AFTERNOON", " ", 12, 13, 14, 15, 16, 17)
    700             .add("EVENING", "", 18, 19, 20, 21, 22, 23)
    701             .add("NIGHT", "", 0, 1, 2, 3, 4, 5)
    702             .build();
    703 
    704         make("eu")
    705             .add("EARLY_MORNING", "goizaldea", 0, 1, 2, 3, 4, 5)
    706             .add("MORNING", "goiza", 6, 7, 8, 9, 10, 11)
    707             .add("AFTERNOON", "eguerdia", 12, 13)
    708             .add("EVENING", "arratsaldea", 14, 15, 16, 17, 18, 19, 20)
    709             .add("NIGHT", "gaua", 21, 22, 23)
    710             .build();
    711 
    712         make("mn")
    713             .add("MORNING", "", 6, 7, 8, 9, 10, 11)
    714             .add("AFTERNOON", "", 12, 13, 14, 15, 16, 17)
    715             .add("EVENING", "", 18, 19, 20)
    716             .add("NIGHT", "", 0, 1, 2, 3, 4, 5, 21, 22, 23)
    717             .build();
    718 
    719         make("my")
    720             .add("MORNING", "", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
    721             .add("AFTERNOON", "", 12, 13, 14, 15)
    722             .add("EVENING", "", 16, 17, 18)
    723             .add("NIGHT", "", 19, 20, 21, 22, 23)
    724             .build();
    725     }
    726 }
    727