Strip blanks from "kanji" (so ^kanji$ search works)
authorVolodymyr Poltavets <Volodymyr.Poltavets@feig.de>
Sat, 12 Jun 2021 21:02:36 +0000 (23:02 +0200)
committerVolodymyr Poltavets <Volodymyr.Poltavets@feig.de>
Sat, 12 Jun 2021 21:02:36 +0000 (23:02 +0200)
demo.sh
jiten-pai.py

diff --git a/demo.sh b/demo.sh
index 0160f7e10433d90a75c548e44c541f609335a657..c939ef99b4173d1ead048f9d7c6c26b36b402e84 100755 (executable)
--- a/demo.sh
+++ b/demo.sh
@@ -4,6 +4,7 @@ dict=/usr/share/gjiten/dics/edict
 
 terms=(
     '^こころ$'
+    '^心$'
     'heart.*spirit'
     'ビール'
 )
index e2f40e8792e344299c30840fb08998f0c4f090d4..b8e35ef34d9714ecf56970ea4965ac19e0e54687 100755 (executable)
@@ -51,6 +51,7 @@ def dict_lookup(dict_fname, term):
                 kanji, kana, trans = re_split.match(line.strip()).groups()
             except:
                 continue
+            kanji = kanji.strip()
             # for now promiscuously try to match anything anywhere
             if re_term.search(kanji) is not None or \
                re_term.search(kana) is not None or \