islex的接口,一个带有重音标记的发音词典。
pysle的Python项目详细描述
发音像“p”+“isle”。
带有重音标记的发音词典的接口 (国际语言词典ISLX) 以及一些用于比较和对齐的工具 发音(例如,某人所说的电话列表与标准或 规范字典发音)。
内容
1 Common Use Cases
你能用这个图书馆做什么?
查找电话和音节列表中的规范发音 字数:
pysle.isletool.LexicalTool.lookup('cat')
将实际发音映射到字典发音(可以使用 自动查找语音错误:
pysle.pronunciationtools.findClosestPronunciation(isleDict, 'cat', ['k', 'æ',])
自动为包含单词和电话的praat文本网格设置音节 (例如,强制对齐文本)–需要 praatIO库:
pysle.syllabifyTextgrid(isleDict, praatioTextgrid, "words", "phones")
根据发音搜索单词:
e.g. Words that start with a sound, or have a sound word medially, or in stressed vowel position, etc. see /tests/dictionary_search.py
2 Major revisions
1.5版(2017年3月3日)
- 进行了大量的错误修复,特别是对音节标记代码的错误修复
版本1.4(2016年7月9日)
- 添加了搜索功能
- 使用新的基于unicode ipa的isledit的移植代码 (旧的是ascii)
- (2016年10月20日)增加了集成测试;使用Travis CI和工作服 用于构建自动化。没有添加新功能。
第1.3版(2016年3月15日)
- 添加了重音元音的标记
版本1.2(2015年6月20日)
- python 3.x支持
版本1.1(2015年1月30日)
- 单词查找速度快约65倍
版本1.0(2014年10月23日)
- 首次公开发行。
3 Requirements
在使用此库之前(安装之前或之后),您将需要 下载伊尔塞克斯字典。它可以在这里下载 “English”部分链接在“English Pronlex”文本下 (文件名为isledit.txt):
Direct link to the ISLEX file used in this project(isledit.txt)
Python 2.7.*或以上
Python 3.3.*或更高(或更低,可能)
如果需要praatIO库 您想使用textgrid功能。它不是必需的 正常使用。
4 Installation
如果您在Windows上,可以使用此处找到的安装程序(请检查它是否是最新的) Windows installer
praatio位于pypi上,可以使用pip从命令行shell安装或升级,如下所示:
pip install praatio --upgrade
否则,要手动安装,请在从github下载源代码后,从命令行shell导航到包含setup.py的目录并键入:
python setup.py install
如果python不在您的路径中,则需要输入完整路径,例如:
C:\Python27\python.exe setup.py install
5 Example usage
下面是一个典型的常用用法:
from pysle import isle isleDict = isle.LexicalTool('C:\islev2.dict') print isleDict.lookup('catatonic')[0] # Get the first pronunciation >> [['k', 'ˌæ'], ['t˺', 'ə'], ['t', 'ˈɑ'], ['n', 'ɪ', 'k']] [2, 0]
还有一个:
from pysle import isle from psyle import pronunciationTools searchWord = 'another' anotherPhoneList = ['n', '@', 'th', 'r'] # Actually produced (ASCII or IPA ok here) returnList = pronunciationTools.findBestSyllabification(isleDict, searchWord, anotherPhoneList) print syllableList >> [["''"], ['n', '@'], ['th', 'r']]
请参见示例用法
6 Citing pysle
Pysle是通用编码,不需要引用 (你应该引用 ISLEX project 但如果你愿意,可以这样引用:
蒂姆·马哈特。皮斯勒。https://github.com/timmahrt/pysle,2016年。
7 Acknowledgements
由于NSF拨款IIS 07-03624,Pysle的开发成为可能 给詹妮弗·科尔和马克·长谷川·约翰逊,NSF拨款BCS 12-51343 致詹妮弗·科尔、何塞·华尔德和卡罗琳·史密斯 致A*Midex项目(N°anr-11-idex-0001-02)和James Sneed German 由法国政府投资项目资助,管理 由法国国家研究机构(anr)负责。