def search(self, query: str) -> typing.List[Station]:
"""
Searches for unique stations that match the query.
"""
logging.debug("Query: %s", query)
return [
self.code_station[code]
for code in collections.OrderedDict.fromkeys(
self.name_station[name].code
for name in difflib.get_close_matches(query.lower(), self.names)
)
]
# Bot implementation.
# ----------------------------------------------------------------------------------------------------------------------
评论列表
文章目录