]> gitweb.fperrin.net Git - DictionaryPC.git/commitdiff
Test path bug.
authorThad Hughes <thad.hughes@gmail.com>
Sat, 17 Dec 2011 02:15:11 +0000 (18:15 -0800)
committerThad Hughes <thad.hughes@gmail.com>
Sat, 17 Dec 2011 02:15:11 +0000 (18:15 -0800)
bugs
src/com/hughes/android/dictionary/engine/DictionaryBuilderTest.java
src/com/hughes/android/dictionary/parser/EnWiktionaryXmlParser.java

diff --git a/bugs b/bugs
index 259529c73a820bca05fee447566c32e0487bd96c..0a5f46f114c8bcb8d6cfd29ad2087363976629cb 100644 (file)
--- a/bugs
+++ b/bugs
@@ -1,3 +1,11 @@
+Setup new ICU
+
+Bad ordering:
+===do===
+  do {{wikipedia|Do (nota)|lang=it}}{{infl|it|noun|g=m}} :: do, the musical note
+  fare {{it-verb}} {{transitive}} :: To do
+
+
 sub-levels in translations.
 examples.  
 
index 71cb4c2b1a1b4dd20b5de3f8513df56194e09cf6..20a017211f3a7524adc23b3bec969e826822e09d 100644 (file)
@@ -119,7 +119,7 @@ public class DictionaryBuilderTest extends TestCase {
 
     // Check it again.
     final Dictionary dict = new Dictionary(new RandomAccessFile(dictFile.getAbsolutePath(), "r"));
-    final PrintStream out = new PrintStream(new File(dictFile.getName() + ".text"));
+    final PrintStream out = new PrintStream(new File(dictFile.getPath() + ".text"));
     dict.print(out);
     out.close();
     assertFilesEqual(GOLDENS + dictName + ".text", dictFile.getPath() + ".text");
index 6eac29d5e4d3054e214217febb120d22bb6660c6..41c7e41d835a8748512e4c3440844548c51a529d 100644 (file)
@@ -554,11 +554,12 @@ public class EnWiktionaryXmlParser {
     } finally {
       // Here's where we exit.
       // TODO: Should we make an entry even if there are no foreign list items?
-      if (foreignBuilder.indexOf(title) == -1) {
-        foreignBuilder.insert(0, title + " ");
+      String foreign = foreignBuilder.toString().trim();
+      if (!foreign.toLowerCase().startsWith(title.toLowerCase())) {
+        foreign = title + " " + foreign;
       }
       for (final ListSection listSection : listSections) {
-        doForeignListItem(foreignBuilder.toString(), title, wordForms, listSection);
+        doForeignListItem(foreign, title, wordForms, listSection);
       }
     }
   }
@@ -603,10 +604,11 @@ public class EnWiktionaryXmlParser {
             englishBuilder.append(text);
             otherIndexBuilder.addEntryWithString(indexedEntry, text, EntryTypeName.WIKTIONARY_ENGLISH_DEF_OTHER_LANG);
           } else if (link.equals("plural")) {
-            englishBuilder.append(englishTokenizer.wikiLinkText());
+            englishBuilder.append(text);
           } else {
             //LOG.warning("Special link: " + englishTokenizer.token());
-            englishBuilder.append(englishTokenizer.wikiLinkText());
+            enIndexBuilder.addEntryWithString(indexedEntry, text, EntryTypeName.WIKTIONARY_ENGLISH_DEF_WIKI_LINK);
+            englishBuilder.append(text);
           }
         } else {
           // link == null