+ public void testWiktionary_WholeSection_DE() throws Exception {
+ wiktionaryTestWithWholeSectionToHtml("wiktionary.WholeSection.DE.quickdic", "DE", 100);
+ }
+
+ public void testWiktionary_WholeSection_EN() throws Exception {
+ wiktionaryTestWithWholeSectionToHtml("wiktionary.WholeSection.EN.quickdic", "EN", 100);
+ }
+
+ public void testWiktionary_WholeSection_IT() throws Exception {
+ // Have to run to 800 to get a few verb conjugations (including essere!)
+ wiktionaryTestWithWholeSectionToHtml("wiktionary.WholeSection.IT.quickdic", "IT", 800);
+ }
+
+ public void wiktionaryTestWithWholeSectionToHtml(final String name, final String langCode, final int pageLimit) throws Exception {
+ final File result = new File(TEST_OUTPUTS + name);
+ System.out.println("Writing to: " + result);
+ DictionaryBuilder.main(new String[] {
+ "--dictOut=" + result.getAbsolutePath(),
+ "--lang1=" + langCode,
+ "--lang2=" + "EN",
+ "--lang1Stoplist=" + STOPLISTS + "empty.txt",
+ "--lang2Stoplist=" + STOPLISTS + "empty.txt",
+ "--dictInfo=SomeWikiDataWholeSection",
+
+ "--input4=" + WIKISPLIT_EN + langCode + ".data",
+ "--input4Name=" + name,
+ "--input4Format=" + WholeSectionToHtmlParser.NAME,
+ "--input4WiktionaryLang=EN",
+ "--input4SkipLang=" + langCode,
+ "--input4TitleIndex=" + "1",
+ "--input4PageLimit=" + pageLimit,
+
+ "--print=" + result.getPath() + ".text",
+ });
+ checkGolden(name, result);
+ }
+
+
+ public void testWiktionary_IT_EN() throws Exception {
+ wiktionaryTestWithLangToEn("wiktionary.it_en.quickdic", "IT", "it.txt",
+ "EN.data", "enwiktionary.english", "Italian", "it", 1000);
+ }
+
+ public void testWiktionary_ZH_EN() throws Exception {
+ wiktionaryTestWithLangToEn("wiktionary.zh_en.quickdic", "ZH", "empty.txt",
+ // These missing "e" prevents a complete match, forcing the name to be printed
+ "EN.data", "enwiktionary.english", "Chinese|Mandarin|Cantones", "zh", 1000);
+ }
+
+ public void testWiktionary_DE_EN() throws Exception {
+ wiktionaryTestWithLangToEn("wiktionary.de_en.quickdic", "DE", "de.txt",
+ "EN.data", "enwiktionary.english", "German", "de", 1000);
+ }
+
+ public void testWiktionary_IT_IT() throws Exception {
+ wiktionaryTestWithLangToEn("wiktionary.it_it.quickdic", "IT", "it.txt",
+ "IT.data", "enwiktionary.italian", "Italian", "it", 1000);
+ }
+
+ // French
+ public void testWiktionary_FR_FR() throws Exception {
+ wiktionaryTestWithLangToEn("wiktionary.fr_fr.quickdic", "FR", "fr.txt",
+ "FR.data", "enwiktionary.french", "French", "fr", 1000);
+ }
+
+
+ // Arabic
+ public void testWiktionary_AR_AR() throws Exception {
+ // Arabic is really big for some reason, use fewer pages.
+ wiktionaryTestWithLangToEn("wiktionary.ar_ar.quickdic", "AR", "empty.txt",
+ "AR.data", "enwiktionary.arabic", "Arabic", "ar", 200);
+ }
+
+ // Chinese
+ public void testWiktionary_ZH_ZH() throws Exception {
+ wiktionaryTestWithLangToEn("wiktionary.zh_zh.quickdic", "ZH", "empty.txt",
+ // These missing "e" prevents a complete match, forcing the name to be printed.
+ "ZH.data", "enwiktionary.chinese", "Chinese|Mandarin|Cantones", "zh", 1000);
+ }
+
+ // German
+ public void testWiktionary_DE_DE() throws Exception {
+ wiktionaryTestWithLangToEn("wiktionary.de_de.quickdic", "DE", "de.txt",
+ "DE.data", "enwiktionary.german", "German", "de", 1000);
+ }
+
+ // Thai
+ public void testWiktionary_TH_TH() throws Exception {
+ wiktionaryTestWithLangToEn("wiktionary.th_th.quickdic", "TH", "empty.txt",
+ // These missing "e" prevents a complete match, forcing the name to be printed.
+ "TH.data", "enwiktionary.thai", "Thai", "th", 1000);
+ }
+
+ public void wiktionaryTestWithLangToEn(final String name, final String lang1,
+ final String stoplist, final String data, final String dictName,
+ final String langPattern, final String langCode, int pageLimit) throws Exception {