From: Reimar Döffinger Date: Fri, 28 Aug 2015 10:37:25 +0000 (+0200) Subject: Hacks to support Spanish wiktionary. X-Git-Url: http://gitweb.fperrin.net/?p=DictionaryPC.git;a=commitdiff_plain;h=0ad5d25ccf108e287dc61a2f19659f9385d03368 Hacks to support Spanish wiktionary. --- diff --git a/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java b/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java index 408ecd9..4faef89 100644 --- a/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java +++ b/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java @@ -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> pathToSelectors = new LinkedHashMap>(); List 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