refactor code (#583)

### What problem does this PR solve?

### Type of change

- [x] Refactoring
This commit is contained in:
KevinHuSh
2024-04-28 13:19:54 +08:00
committed by GitHub
parent aadb9cbec8
commit 9d60a84958
25 changed files with 48 additions and 525 deletions

View File

@@ -17,12 +17,12 @@ class Dealer:
try:
self.dictionary = json.load(open(path, 'r'))
except Exception as e:
logging.warning("Missing synonym.json")
logging.warn("Missing synonym.json")
self.dictionary = {}
if not redis:
logging.warning(
"Real-time synonym is disabled, since no redis connection.")
"Realtime synonym is disabled, since no redis connection.")
if not len(self.dictionary.keys()):
logging.warning(f"Fail to load synonym")