]> gitweb.fperrin.net Git - DictionaryPC.git/commitdiff
Improve wiktionary splitter for Spanish and Portuguese
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 9 Jan 2019 20:43:52 +0000 (21:43 +0100)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 9 Jan 2019 20:43:52 +0000 (21:43 +0100)
src/com/hughes/android/dictionary/engine/WiktionarySplitter.java

index 056fabe44b0f9e5a050cfdd7a9e70c3f32ca98e6..435c3f212cd623cf9456054768d6feab355abfe4 100644 (file)
@@ -187,6 +187,15 @@ public class WiktionarySplitter extends org.xml.sax.helpers.DefaultHandler {
                 title.startsWith("Plantilla:") ||
                 title.startsWith("Wikcionario:") ||
 
                 title.startsWith("Plantilla:") ||
                 title.startsWith("Wikcionario:") ||
 
+                // PT
+                title.startsWith("Ajuda:") ||
+                title.startsWith("Apêndice:") ||
+                title.startsWith("Citações:") ||
+                title.startsWith("Portal:") ||
+                title.startsWith("Predefinição:") ||
+                title.startsWith("Vocabulário:") ||
+                title.startsWith("Wikcionário:") ||
+
                 // sentinel
                 false
                ) return;
                 // sentinel
                 false
                ) return;
@@ -196,6 +205,8 @@ public class WiktionarySplitter extends org.xml.sax.helpers.DefaultHandler {
         }
 
         String text = textBuilder.toString();
         }
 
         String text = textBuilder.toString();
+        // Workaround for Spanish wiktionary {{ES}} pattern
+        text = text.replace("{{ES}}", "== {{lengua|es}} ==");
         String translingual = "";
         int start = 0;
         final Matcher startMatcher = headingStart.matcher(text);
         String translingual = "";
         int start = 0;
         final Matcher startMatcher = headingStart.matcher(text);