2023-04-22 22:56:52 +00:00
|
|
|
from bot.entries.jitenon import JitenonEntry
|
2023-04-10 20:20:33 +00:00
|
|
|
|
|
|
|
|
2023-04-22 22:56:52 +00:00
|
|
|
class JitenonYojiEntry(JitenonEntry):
|
2023-04-10 20:20:33 +00:00
|
|
|
columns = {
|
|
|
|
"四字熟語": ["expression", ""],
|
|
|
|
"読み方": ["yomikata", ""],
|
|
|
|
"意味": ["imi", ""],
|
|
|
|
"出典": ["shutten", ""],
|
|
|
|
"漢検級": ["kankenkyuu", ""],
|
|
|
|
"場面用途": ["bamenyouto", ""],
|
|
|
|
"異形": ["ikei", []],
|
|
|
|
"類義語": ["ruigigo", []],
|
|
|
|
}
|
|
|
|
|
|
|
|
def __init__(self, sequence):
|
2023-04-22 22:56:52 +00:00
|
|
|
super().__init__(sequence)
|
2023-04-10 20:20:33 +00:00
|
|
|
|
|
|
|
def yomichan_terms(self):
|
|
|
|
terms = []
|
|
|
|
for idx, headword in enumerate(self._headwords()):
|
|
|
|
(expression, reading) = headword
|
|
|
|
definition_tags = None
|
|
|
|
inflection_rules = ""
|
|
|
|
score = -idx
|
|
|
|
glossary = self.yomichan_glossary
|
|
|
|
sequence = self.sequence
|
|
|
|
term_tags = self.__term_tags()
|
|
|
|
term = [
|
|
|
|
expression, reading, definition_tags, inflection_rules,
|
|
|
|
score, glossary, sequence, term_tags
|
|
|
|
]
|
|
|
|
terms.append(term)
|
|
|
|
return terms
|
|
|
|
|
|
|
|
def __term_tags(self):
|
|
|
|
tags = self.kankenkyuu.replace(" ", "").split("/")
|
|
|
|
return " ".join(tags)
|