]> gitweb.fperrin.net Git - DictionaryPC.git/commitdiff
Don't handle it-conj in EnParser.
authorthadh <thadh@thadh-macbookpro>
Tue, 25 Sep 2012 15:42:10 +0000 (08:42 -0700)
committerthadh <thadh@thadh-macbookpro>
Tue, 25 Sep 2012 15:42:10 +0000 (08:42 -0700)
src/com/hughes/android/dictionary/parser/wiktionary/AbstractWiktionaryParser.java
src/com/hughes/android/dictionary/parser/wiktionary/EnFunctionCallbacks.java
src/com/hughes/android/dictionary/parser/wiktionary/EnParser.java
todo.txt

index 765ea9aef55faf1ab09cc444db2f6b312ed21b2e..b27d554fc0571a0cde4b5f6925963c081a87a3a1 100644 (file)
@@ -110,7 +110,7 @@ public abstract class AbstractWiktionaryParser implements Parser {
   }
   
   public void addLinkToCurrentEntry(final String token, final EntryTypeName entryTypeName) {
-      assert false : token;
+      assert false : token + ", title=" + title;
   }
 
   
index dbd158b7ca68f8e54e164b0dc75eb0d90199ba37..60de2fc82c6c1c1e9ff481ae48aa1843f907d128 100644 (file)
@@ -64,6 +64,9 @@ class EnFunctionCallbacks {
       callbacks.put("rfquote", callback);
       callbacks.put("attention", callback);
       callbacks.put("zh-attention", callback);
+      callbacks.put("top2", callback);
+      callbacks.put("mid2", callback);
+      callbacks.put("bottom", callback);
       
       callback = new AppendName<T>();
       callbacks.put("...", callback);
@@ -624,6 +627,12 @@ class EnFunctionCallbacks {
           appendAndIndexWikiCallback.dispatch(f, null, null);
           appendAndIndexWikiCallback.builder.append(" {f}");
       }
+      final String m = namedArgs.remove("f");
+      if (m != null) {
+          appendAndIndexWikiCallback.builder.append(", ");
+          appendAndIndexWikiCallback.dispatch(m, null, null);
+          appendAndIndexWikiCallback.builder.append(" {m}");
+      }
       parser.wordForms.add(singular);
       parser.wordForms.add(plural);
       if (!namedArgs.isEmpty() || args.size() > 4) {
index 7fdea865f3349c9533fcc6dc76f2d5b79dc54b36..13227adea7adae45e0f2e5a30b5c80ea9975f9b3 100644 (file)
@@ -91,6 +91,12 @@ public abstract class EnParser extends AbstractWiktionaryParser {
   final AppendAndIndexWikiCallback<EnParser> appendAndIndexWikiCallback = new AppendAndIndexCallback(this);
   {
     appendAndIndexWikiCallback.functionCallbacks.putAll(EnFunctionCallbacks.DEFAULT);
+    for (final String key : new ArrayList<String>(appendAndIndexWikiCallback.functionCallbacks.keySet())) {
+        // Don't handle the it-conj functions here.
+        if (key.startsWith("it-conj")) {
+            appendAndIndexWikiCallback.functionCallbacks.remove(key);
+        }
+    }
   }
   
   EnParser(final IndexBuilder enIndexBuilder, final IndexBuilder otherIndexBuilder, final Pattern langPattern, final Pattern langCodePattern, final boolean swap) {
index e8a26d2180ae4abb8f17cb12bf3fe0abfd4a822e..3bea956de0f70c99136eda0cc34ca671f4525a3e 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -1,3 +1,9 @@
+delete these entries:
+# {{conjugation of|abalienare||2|p|pres|ind|lang=it}}
+# {{conjugation of|abalienare||2|p|imp|lang=it}}
+# {{form of|[[feminine|Feminine]] plural|abalienato}}
+
+
 HtmlEntry
   - text inside functions doesn't get escaped properly.
   - Skips Uebersetzung section (likewise in other langs), except maybe for the other lange of interest.