处理汉语拼音的实用程序
pinyin-utils的Python项目详细描述
在自述文件.md在
汉语拼音处理工具
这个库中的实用程序使它易于使用 汉语拼音
单元测试直接在文件中,因此 作为it中实用功能的文档。 要执行单元测试,只需运行:
pytest -s pinyin_utils.py
要将库放入项目中,请执行以下操作:
^{pr2}$拼音概要_实用工具.py在
很快就要来了
概要翻译.py在
importos,time,trio,asks,pprintfromtranslateimporttranslate,initDB,setApiKeyasyncdefmain():# --- The database need not exist.# Furthermore, if you leave out this call,# the database will be put at ./Translations.db by defaultinitDB('./Translations.db')# --- This env var key is the default if you leave this outsetApiKey(os.environ['GOOGLE_APIKEY'])hWords={'cat':None,'dog':None,}start_time=time.time()asyncwithtrio.open_nursery()asnursery:nursery.start_soon(translate,hWords)total=time.time()-start_timeprint(f"Total time: {total}")pprint.PrettyPrinter(indent=3).pprint(hWords)asks.init('trio')trio.run(main)# SYNOPSIS of tabdb.pycomingsoon# SYNOPSIS of englishWords.pycomingsoon# SYNOPSIS of ChineseDB.pycomingsoon
- 项目
标签: