X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=src%2Fcom%2Fhughes%2Fandroid%2Fdictionary%2FEntry.java;h=6143b4948d338c9e7f50b24b2ba04e2075a8e6b2;hb=4f9af3906020f72d890c213a33b77e1afef54959;hp=cd62f068f30c9f93a13b6667dfd8406cbbfcfa27;hpb=2552fd5fee12af72b798ce0b13a0152781c2e749;p=Dictionary.git diff --git a/src/com/hughes/android/dictionary/Entry.java b/src/com/hughes/android/dictionary/Entry.java index cd62f06..6143b49 100755 --- a/src/com/hughes/android/dictionary/Entry.java +++ b/src/com/hughes/android/dictionary/Entry.java @@ -140,13 +140,18 @@ public final class Entry implements RAFSerializable { public Set getIndexableTokens(final byte lang) { final Set result = new LinkedHashSet(); - String text = Arrays.asList(getAllText(lang)).toString(); + String text = " "; + for (final String subentry : getAllText(lang)) { + text += subentry + " "; + } text = text.replaceAll("fig\\.", " "); text = text.replaceAll("\\{[^\\}]+}", " "); text = text.replaceAll("\"-", "-"); text = text.replaceAll("-\"", "-"); - text = text.replaceAll("[\":/\\()<>\\[\\],;?!.]", " "); + text = text.replaceAll("[\"/\\()<>\\[\\],;?!.]", " "); + text = text.replaceAll("[:] ", " "); + text = text.replaceAll(" [:]", " "); result.addAll(Arrays.asList(WHITESPACE.split(text))); text = text.replaceAll("[-]", " ");