]> gitweb.fperrin.net Git - DictionaryPC.git/blobdiff - src/com/hughes/android/dictionary/engine/WiktionarySplitter.java
Hacks to support Spanish wiktionary.
[DictionaryPC.git] / src / com / hughes / android / dictionary / engine / WiktionarySplitter.java
index 408ecd9de3c539f36cedeb366cbb1ab2c21f6c38..4faef895aa7b70eb086acfd9d119f41bc4004b47 100644 (file)
@@ -39,7 +39,8 @@ public class WiktionarySplitter extends org.xml.sax.helpers.DefaultHandler {
 
   // The matches the whole line, otherwise regexes don't work well on French:
   // {{=uk=}}
-  static final Pattern headingStart = Pattern.compile("^(=+)[^=].*$", Pattern.MULTILINE);
+  // Spanish has no initial headings, so also detect {{ES as such...
+  static final Pattern headingStart = Pattern.compile("^(\\{\\{ES|(=+)[^=]).*$", Pattern.MULTILINE);
   
   final Map<String,List<Selector>> pathToSelectors = new LinkedHashMap<String, List<Selector>>();
   List<Selector> currentSelectors = null;
@@ -146,6 +147,13 @@ public class WiktionarySplitter extends org.xml.sax.helpers.DefaultHandler {
             title.startsWith("Categoria:") ||
             title.startsWith("Aiuto:") ||
             title.startsWith("Portail:") ||
+            // ES
+            title.startsWith("ApĂ©ndice:") ||
+            title.startsWith("Archivo:") ||
+            title.startsWith("Ayuda:") ||
+            title.startsWith("CategorĂ­a:") ||
+            title.startsWith("Plantilla:") ||
+            title.startsWith("Wikcionario:") ||
 
             // sentinel
             false