class_docstr: Chinese Text Processor class
class_docstr_tok: ["Chinese","Text","Processor","class"]
code: def generate_synonym_dict(self, synonym_file):
      from collections import defaultdict
  
      synonym_dict = defaultdict(set)
      f = open(synonym_file, "r", encoding="utf-8")
      lines = f.readlines()
      for line in lines:
          words = line.strip().split()[1:]
          for i in range(len(words)):
              for j in range(i + 1, len(words)):
                  synonym_dict[words[i]].add(words[j])
                  synonym_dict[words[j]].add(words[i])
      self.__synonym_dict = synonym_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 10 for calling the CnProcessor obj's underlying member method code with example usage: obj.generate_synonym_dict(synonym_file) without return types