用于处理行间转换文本的Python库。
pyigt的Python项目详细描述
pyigt:用Python处理行间带注释的文本
此库提供对I内联G丢失{str 1}$Text(IGT)的轻松访问 到Leipzig Glossing Rules,存储为CLDF examples。在
安装
通过pip安装pyigt
pip install pyigt
将安装Python包和命令行界面igt
。在
使用
CLI
^{pr2}$igt ls
命令允许从命令行检查igt,使用
四条标准线描述在莱比锡光泽规则,其中分析文本和
光泽度对齐,例如
$ igt ls tests/fixtures/examples.csv Example 1: zəple: ȵike: peji qeʴlotʂuʁɑ, zəp-le: ȵi-ke: pe-ji qeʴlotʂu-ʁɑ, earth-DEF:CL WH-INDEF:CL become-CSM in.the.past-LOC ... Example 5: zuɑməɸu oʐgutɑ ipiχuɑȵi, zuɑmə-ɸu o-ʐgu-tɑ i-pi-χuɑ-ȵi, cypress-tree one-CL-LOC DIR-hide-because-ADV IGT corpus at tests/fixtures/examples.csv
igt ls
可以与其他命令行工具(如
csvkit过滤包:
$ csvgrep -c Primary_Text -m"ȵi" tests/fixtures/examples.csv | csvgrep -c Gloss -m"ADV"| igt ls - Example 5: zuɑməɸu oʐgutɑ ipiχuɑȵi, zuɑmə-ɸu o-ʐgu-tɑ i-pi-χuɑ-ȵi, cypress-tree one-CL-LOC DIR-hide-because-ADV
Python API
>>>frompyigtimportCorpus>>>corpus=Corpus.from_path('tests/fixtures/cldf-metadata.json')>>>len(corpus)>>>len(corpus)5>>>forigtincorpus:...print(igt)...break...zəple:ȵike:pejiqeʴlotʂuʁɑ,zəp-le:ȵi-ke:pe-jiqeʴlotʂu-ʁɑ,earth-DEF:CLWH-INDEF:CLbecome-CSMin.the.past-LOC
另请参见
- interlineaR-具有类似功能的R包,但支持更多的输入格式。在
- 项目
标签: