From db867ac06ddeb858f5a70f682e71826346c31895 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Reimar=20D=C3=B6ffinger?= Date: Wed, 9 Jan 2019 21:43:52 +0100 Subject: [PATCH] Improve wiktionary splitter for Spanish and Portuguese --- .../android/dictionary/engine/WiktionarySplitter.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java b/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java index 056fabe..435c3f2 100644 --- a/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java +++ b/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java @@ -187,6 +187,15 @@ public class WiktionarySplitter extends org.xml.sax.helpers.DefaultHandler { 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; @@ -196,6 +205,8 @@ public class WiktionarySplitter extends org.xml.sax.helpers.DefaultHandler { } 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); -- 2.43.0