From: Volodymyr Poltavets Date: Sat, 12 Jun 2021 21:02:36 +0000 (+0200) Subject: Strip blanks from "kanji" (so ^kanji$ search works) X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=aa933f4de73ba3bb79dbe29a8825c563913d8af1;p=jiten-pai.git Strip blanks from "kanji" (so ^kanji$ search works) --- diff --git a/demo.sh b/demo.sh index 0160f7e..c939ef9 100755 --- a/demo.sh +++ b/demo.sh @@ -4,6 +4,7 @@ dict=/usr/share/gjiten/dics/edict terms=( '^こころ$' + '^心$' 'heart.*spirit' 'ビール' ) diff --git a/jiten-pai.py b/jiten-pai.py index e2f40e8..b8e35ef 100755 --- a/jiten-pai.py +++ b/jiten-pai.py @@ -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 \