From: Christoph Lingg Date: Sun, 20 Dec 2020 01:11:30 +0000 (+0100) Subject: include dict.cc entries with subject labels X-Git-Url: http://gitweb.fperrin.net/?p=DictionaryPC.git;a=commitdiff_plain;h=6c9b88ee08f4fd4cba28714b93fceda740f313e5 include dict.cc entries with subject labels I used this script to turn a DE-ES dict.cc file into a quickdic compatible with my Tolino. From the original 45k entries more than 20k were dropped because they had a subject label: > WARNING: Malformed line: Atomphysik {f} física {f} atómica noun [phys.] This change allows lines to have 4 fields/columns: `language1`, `language2`, `word class`, `subject labels`. see also https://github.com/natowi/quickdic-dictionary.dictionarypc/issues/1 --- diff --git a/src/com/hughes/android/dictionary/parser/DictFileParser.java b/src/com/hughes/android/dictionary/parser/DictFileParser.java index e9c6180..0fa4306 100644 --- a/src/com/hughes/android/dictionary/parser/DictFileParser.java +++ b/src/com/hughes/android/dictionary/parser/DictFileParser.java @@ -110,9 +110,8 @@ public class DictFileParser implements Parser { return; } final String[] fields = fieldSplit.split(line); - // dictcc now has a part of speech field as field #3. - if (fields.length < 2 || fields.length > 3) { - logger.warning("Malformed line: " + line); + if (fields.length < 2 || fields.length > 4) { + logger.warning("Malformed line, expected 3 or 4 fields, got " + fields.length + ": " + line); return; }