phrases_dict.py 421 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from codecs import open
  4. import json
  5. import os
  6. _current_dir = os.path.dirname(os.path.realpath(__file__))
  7. _json_path = os.path.join(_current_dir, 'phrases_dict.json')
  8. phrases_dict = {}
  9. def _load_phrases_dict():
  10. global phrases_dict
  11. with open(_json_path, encoding='utf8') as fp:
  12. phrases_dict = json.loads(fp.read())
  13. _load_phrases_dict()