- static final String INPUTS = "../DictionaryData/inputs/";
- static final String STOPLISTS = "../DictionaryData/inputs/stoplists/";
- static final String OUTPUTS = "../DictionaryData/outputs/";
-
- public static void main(final String[] args) throws Exception {
-
- final Map<String,String> isoToWikiName = new LinkedHashMap<String, String>(Language.isoCodeToWikiName);
- isoToWikiName.remove("EN");
- isoToWikiName.remove("DE");
-
- final Map<String,String> isoToDedication = new LinkedHashMap<String, String>();
- isoToDedication.put("AF", "Afrikaans dictionary dedicated to Heiko and Mariëtte Horn.");
- isoToDedication.put("HR", "Croation dictionary dedicated to Ines Viskic and Miro Kresonja.");
- isoToDedication.put("NL", "Dutch dictionary dedicated to Mike LeBeau.");
- // German handled in file.
- isoToDedication.put("EL", "Greek dictionary dedicated to Noah Egge.");
- isoToDedication.put("IT", "Italian dictionary dedicated to Carolina Tropini, my favorite stardust in the whole universe! Ti amo!");
- isoToDedication.put("JA", "Japanese dictionary dedicated to Akane Watanabe.");
- isoToDedication.put("KO", "Korean dictionary dedicated to Ande Elwood--fall fashion und Fernsehturms!");
- isoToDedication.put("PT", "Portuguese dictionary dedicated to Carlos Melo, one Tough Mudder.");
- isoToDedication.put("RO", "Romanian dictionary dedicated to Radu Teodorescu.");
- isoToDedication.put("RU", "Russian dictionary dedicated to Maxim Aronin--best friend always!.");
- isoToDedication.put("SR", "Serbian dictionary dedicated to Filip Crnogorac--thanks for the honey.");
- isoToDedication.put("ES", "Spanish dictionary made especially for Carolina Tropini! <3 XoXoXXXXX!");
- isoToDedication.put("SV", "Swedish dictionary dedicated to Kajsa Palmblad--björn kramar!");
-
- final Map<String,String> isoToStoplist = new LinkedHashMap<String, String>();
- isoToStoplist.put("DE", "de.txt");
- isoToStoplist.put("EN", "en.txt");
- isoToStoplist.put("ES", "es.txt");
- isoToStoplist.put("IT", "it.txt");
- isoToStoplist.put("FR", "fr.txt");
-
- final Map<String,String> isoToRegex = new LinkedHashMap<String, String>();
- isoToRegex.put("ZH", ".*Chinese.*|.*Mandarin.*|.*Cantonese.*");
+ static final String INPUTS = "data/inputs/";
+ static final String STOPLISTS = "data/inputs/stoplists/";
+ static final String OUTPUTS = "data/outputs/";
+
+ // Build the non EN ones.
+ static final String[][] nonEnPairs = new String[][] {
+ {"EN"},
+ {"DE"},
+ {"IT"},
+ // This one takes a really long time:
+ // {"FR"},
+
+ // The 3 I use most:
+ {"IT", "EN" },
+ {"DE", "EN" },
+ {"DE", "IT" },
+
+ {"AR", "DE" },
+ {"AR", "ES" },
+ {"AR", "FR" },
+ {"AR", "HE" },
+ {"AR", "IT" },
+ {"AR", "JA" },
+ {"AR", "RU" },
+ {"AR", "TR" }, // Turkish
+ {"AR", "cmn" },
+
+ {"DE", "AR" },
+ {"DE", "FR" },
+ {"DE", "CA" }, // Catalan
+ {"DE", "CS" }, // Czech
+ {"DE", "EO" }, // Esperanto
+ {"DE", "ES" },
+ {"DE", "FR" },
+ {"DE", "HE" },
+ {"DE", "HU" }, // Hungarian
+ {"DE", "IT" },
+ {"DE", "JA" },
+ {"DE", "LA" }, // Latin
+ {"DE", "NL" }, // Dutch
+ {"DE", "PL" }, // Polish
+ {"DE", "RU" },
+ {"DE", "SV" }, // Swedish
+ {"DE", "TR" }, // Turkish
+ {"DE", "cmn" },
+ {"DE", "TA" }, // Tamil
+
+ {"ES", "RU" }, // Spanish-Russian
+
+ {"FR", "BG" }, // Bulgarian
+ {"FR", "CS" }, // Czech
+ {"FR", "DE" },
+ {"FR", "ES" },
+ {"FR", "IT" },
+ {"FR", "JA" },
+ {"FR", "LA" },
+ {"FR", "NL" }, // Dutch
+ {"FR", "RU" },
+ {"FR", "TR" }, // Turkish
+ {"FR", "cmn" },
+ {"FR", "EL" },
+
+ {"IT", "DE" },
+ {"IT", "EL" }, // Greek
+ {"IT", "ES" },
+ {"IT", "FR" },
+ {"IT", "HU" },
+ {"IT", "JA" },
+ {"IT", "LA" }, // Latin
+ {"IT", "LV" }, // Latvian
+ {"IT", "NL" },
+ {"IT", "PL" },
+ {"IT", "RU" },
+ {"IT", "SV" },
+ {"IT", "TR" }, // Turkish
+ {"IT", "cmn" },
+
+ {"JA", "cmn" },
+ {"JA", "AR" },
+ {"JA", "KO" },
+
+ {"cmn", "AR" },
+ {"cmn", "DE" },
+ {"cmn", "ES" },
+ {"cmn", "FR" },
+ {"cmn", "IT" },
+ {"cmn", "KO" },
+
+
+ {"NO", "SV" },
+ {"NO", "FI" },
+ {"FI", "SV" },
+
+ {"PL", "FR" }, // Polish
+ {"PL", "RU" }, // Polish
+ {"PL", "HU" }, // Polish
+ {"PL", "ES" }, // Polish
+
+ {"TR", "EL" }, // Turkish, Greek
+
+ {"FA", "HY" }, // Persian, Armenian, by request.
+ {"FA", "SV" }, // Persian, Swedish, by request.
+ {"NL", "PL" }, // Dutch, Polish, by request.
+ };
+
+
+
+ static final Map<String,String> isoToDedication = new LinkedHashMap<String, String>();
+ static {
+ isoToDedication.put("AF", "Afrikaans dictionary dedicated to Heiko and Mariëtte Horn.");
+ isoToDedication.put("HR", "Croatian dictionary dedicated to Ines Viskic and Miro Kresonja.");
+ isoToDedication.put("NL", "Dutch dictionary dedicated to Mike LeBeau.");
+ // German handled in file.
+ isoToDedication.put("EL", "Greek dictionary dedicated to Noah Egge.");
+ isoToDedication.put("IT", "Italian dictionary dedicated to Carolina Tropini, my favorite stardust in the whole universe! Ti amo!");
+ isoToDedication.put("KO", "Korean dictionary dedicated to Ande Elwood--fall fashion und Fernsehturms!");
+ isoToDedication.put("PT", "Portuguese dictionary dedicated to Carlos Melo, one Tough Mudder.");
+ isoToDedication.put("RO", "Romanian dictionary dedicated to Radu Teodorescu.");
+ isoToDedication.put("RU", "Russian dictionary dedicated to Maxim Aronin--best friend always!.");
+ isoToDedication.put("SR", "Serbian dictionary dedicated to Filip Crnogorac--thanks for the honey.");
+ isoToDedication.put("ES", "Spanish dictionary made especially for Carolina Tropini! <3 XoXoXXXXX!");
+ isoToDedication.put("SV", "Swedish dictionary dedicated to Kajsa Palmblad--björn kramar!");
+ }
+ private static String getDedication(String iso) {
+ return isoToDedication.containsKey(iso) ? "\n\n" + isoToDedication.get(iso) : "";
+ }
+
+ static final Map<String,String> isoToStoplist = new LinkedHashMap<String, String>();
+ static {
+ isoToStoplist.put("DE", "de.txt");
+ isoToStoplist.put("EN", "en.txt");
+ isoToStoplist.put("ES", "es.txt");
+ isoToStoplist.put("IT", "it.txt");
+ isoToStoplist.put("FR", "fr.txt");
+ }
+ private static String getStoplist(String iso) {
+ return isoToStoplist.containsKey(iso) ? isoToStoplist.get(iso) : "empty.txt";
+ }
+
+ static String getOtherLang(final String[] pair, final String first) {
+ assert Arrays.asList(pair).contains(first);
+ assert pair.length == 2;
+ return pair[0].equals(first) ? pair[1] : pair[0];
+ }
+
+ static List<String> getMainArgs(final String[] pair) {
+ final List<String> result = new ArrayList<String>();
+
+ int i = 1;