From 5cbe1a260e687c6b205db31b0c649373e8ea7a29 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Fri, 8 Nov 2013 14:36:21 -0800 Subject: [PATCH] Splitting tags before returning them from dictionary Former-commit-id: fb659e1a6ac96f416d8964e4ef52ee00c772bb10 --- yomi_base/japanese2/dictionary.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yomi_base/japanese2/dictionary.py b/yomi_base/japanese2/dictionary.py index 9e083e6..ee976b4 100644 --- a/yomi_base/japanese2/dictionary.py +++ b/yomi_base/japanese2/dictionary.py @@ -33,7 +33,12 @@ class Dictionary: cursor = self.db.cursor() cursor.execute('SELECT * FROM Terms WHERE expression {0} ? OR reading=?'.format('LIKE' if partial else '='), (word, word)) - return cursor.fetchall() + + results = list() + for expression, reading, definitions, tags in cursor.fetchall(): + results.append((expression, reading, definitions, tags.split())) + + return results def findCharacter(self, character):