]> gitweb.fperrin.net Git - DictionaryPC.git/blobdiff - src/com/hughes/android/dictionary/engine/DictionaryBuilderTest.java
Bug-fixes to WikiTokenizer (handle weird line-feed), update to newest
[DictionaryPC.git] / src / com / hughes / android / dictionary / engine / DictionaryBuilderTest.java
index 7f1bebaa06aed5f62bb8ee4ce9c91ba3e81943e8..e3a8acc401c75e1d0b6b032777c0bafd16816ff7 100644 (file)
@@ -80,11 +80,19 @@ public class DictionaryBuilderTest extends TestCase {
         "DE.data", "enwiktionary.german", "German", "it");
   }
 
+  // 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");
+  }
+
   public void wiktionaryTestWithLangToEn(final String name, final String lang1,
       final String stoplist, final String data, final String dictName,
       final String langPattern, final String langCode) throws Exception {
     final File result = new File(TEST_OUTPUTS + name);
     System.out.println("Writing to: " + result);
+    final String type = data.equals("EN.data") ? "EnToTranslation" : "EnForeign";
     DictionaryBuilder.main(new String[] {
         "--dictOut=" + result.getAbsolutePath(),
         "--lang1=" + lang1,
@@ -96,6 +104,7 @@ public class DictionaryBuilderTest extends TestCase {
         "--input4=" + WIKISPLIT + data,
         "--input4Name=" + dictName,
         "--input4Format=enwiktionary",
+        "--input4WiktionaryType=" + type,
         "--input4LangPattern=" + langPattern,
         "--input4LangCodePattern=" + langCode,
         "--input4EnIndex=2",