X-Git-Url: http://gitweb.fperrin.net/?p=DictionaryPC.git;a=blobdiff_plain;f=src%2Fcom%2Fhughes%2Fandroid%2Fdictionary%2Fengine%2FWiktionarySplitter.java;h=28b11bc669f3cbdb146a4a41c4dc2afc802ae2a9;hp=0624025387b7f134242de98736ec4082e4915029;hb=cde823acd318d713335c4ec5ea35e708063abea5;hpb=b3b942928b2efb012c2b666a3638c546feecee5c diff --git a/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java b/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java index 0624025..28b11bc 100644 --- a/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java +++ b/src/com/hughes/android/dictionary/engine/WiktionarySplitter.java @@ -209,22 +209,25 @@ public class WiktionarySplitter extends org.xml.sax.helpers.DefaultHandler { text = text.substring(startMatcher.end()); final String heading = startMatcher.group(); - for (final Selector selector : currentSelectors) { - if (heading.indexOf("Translingual") != -1) { - // Find end. - final int depth = startMatcher.group(1).length(); - final Pattern endPattern = getEndPattern(depth); - final Matcher endMatcher = endPattern.matcher(text); - if (endMatcher.find()) { - int end = endMatcher.start(); - translingual = text.substring(0, endMatcher.start()); - text = text.substring(end); - break; - } + // For Translingual entries just store the text for later + // use in the per-language sections + if (heading.indexOf("Translingual") != -1) { + // Find end. + final int depth = startMatcher.group(1).length(); + final Pattern endPattern = getEndPattern(depth); + + final Matcher endMatcher = endPattern.matcher(text); + if (endMatcher.find()) { + int end = endMatcher.start(); + translingual = text.substring(0, endMatcher.start()); + text = text.substring(end); + continue; } - if (selector.pattern.matcher(heading).find()) { + } + for (final Selector selector : currentSelectors) { + if (selector.pattern.matcher(heading).find()) { // Find end. final int depth = startMatcher.group(1).length(); final Pattern endPattern = getEndPattern(depth);