From dcb425b066280fd4f8943d84e6976739bd2b5789 Mon Sep 17 00:00:00 2001 From: stephenmk Date: Mon, 10 Apr 2023 23:41:43 -0500 Subject: [PATCH] Relocate special case logic --- entries/jitenon.py | 3 --- entries/jitenon_kotowaza.py | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/entries/jitenon.py b/entries/jitenon.py index 7035cff..44740e7 100644 --- a/entries/jitenon.py +++ b/entries/jitenon.py @@ -73,9 +73,6 @@ class Jitenon: def _headwords(self): words = [] - if self.expression == "金棒引き・鉄棒引き": - # special case - return [["金棒引き", "かなぼうひき"], ["金棒引き", "かなぼうひき"]] for yomikata in self.__yomikatas(): headword = [self.expression, yomikata] if headword in words: diff --git a/entries/jitenon_kotowaza.py b/entries/jitenon_kotowaza.py index 1b7b352..bcf608e 100644 --- a/entries/jitenon_kotowaza.py +++ b/entries/jitenon_kotowaza.py @@ -32,3 +32,10 @@ class JitenonKotowaza(Jitenon): ] terms.append(term) return terms + + def _headwords(self): + if self.expression == "金棒引き・鉄棒引き": + return [["金棒引き", "かなぼうひき"], + ["鉄棒引き", "かなぼうひき"]] + else: + return Jitenon._headwords(self)