class_docstr: Chinese Text Processor class
class_docstr_tok: ["Chinese","Text","Processor","class"]
code: def generate_antonym_dict(self, antonym_file):
      from collections import defaultdict
  
      antonym_dict = defaultdict(set)
      f = open(antonym_file, "r", encoding="utf-8")
      lines = f.readlines()
      for line in lines:
          try:
              word1, word2 = (
                  line.strip()
                  .replace("-", " ")
                  .replace("—", " ")
                  .replace("─", " ")
                  .replace("―", " ")
                  .split()
              )
          except Exception:
              pass
          antonym_dict[word1].add(word2)
          antonym_dict[word2].add(word1)
      self.__antonym_dict = antonym_dict
  
file_path: textflint/textflint/common/preprocess/cn_processor.py
imports: import threading
  from ..settings import CN_SYNONYM_PATH, CN_ANTONYM_PATH
  from ..utils.install import download_if_needed
label_desc: Use image node_id 12 for calling the CnProcessor obj's underlying member method code with example usage: obj.generate_antonym_dict(antonym_file) without return types