Relocate special case logic

This commit is contained in:
stephenmk 2023-04-10 23:41:43 -05:00
parent be47717638
commit dcb425b066
No known key found for this signature in database
GPG key ID: B6DA730DB06235F1
2 changed files with 7 additions and 3 deletions

View file

@ -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:

View file

@ -32,3 +32,10 @@ class JitenonKotowaza(Jitenon):
]
terms.append(term)
return terms
def _headwords(self):
if self.expression == "金棒引き・鉄棒引き":
return [["金棒引き", "かなぼうひき"],
["鉄棒引き", "かなぼうひき"]]
else:
return Jitenon._headwords(self)