From: Frédéric Perrin Date: Sun, 7 Feb 2021 00:35:19 +0000 (+0000) Subject: Escape only unicode chars X-Git-Url: https://gitweb.fperrin.net/?p=DictionaryPC.git;a=commitdiff_plain;h=a477616ed29b1664f78f9f492be29097eb0d6e49 Escape only unicode chars --- diff --git a/src/com/hughes/android/dictionary/parser/DictFileParser.java b/src/com/hughes/android/dictionary/parser/DictFileParser.java index 1f08428..ef71a68 100644 --- a/src/com/hughes/android/dictionary/parser/DictFileParser.java +++ b/src/com/hughes/android/dictionary/parser/DictFileParser.java @@ -157,8 +157,8 @@ public class DictFileParser implements Parser { if (singleLang) { HtmlEntry htmlEntry = new HtmlEntry(entrySource, fields[0]); - htmlEntry.html = StringUtil.escapeUnicodeToPureHtml(fields[1]); - + htmlEntry.html = StringUtil.escapeUnicodeToPureHtml(fields[1], false); + final IndexBuilder titleIndexBuilder = dictBuilder.indexBuilders.get(0); htmlEntry.addToDictionary(titleIndexBuilder.index.dict); @@ -170,6 +170,9 @@ public class DictFileParser implements Parser { if (tokens.length > 1) { for (final String token : tokens) { assert token.length() >= 1; + if (token.length() <= 2) { + continue; + } assert token.indexOf("-") == -1; if (/*!alreadyDone.contains(token) && */!token.isEmpty()) { tokenData = titleIndexBuilder.getOrCreateTokenData(token);