From 0ad5d25ccf108e287dc61a2f19659f9385d03368 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Reimar=20D=C3=B6ffinger?= Date: Fri, 28 Aug 2015 12:37:25 +0200 Subject: [PATCH] Hacks to support Spanish wiktionary. --- .../android/dictionary/engine/WiktionarySplitter.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.43.0