我正在使用适用于 Python 2.7 的 LingPy 1.0.1 库,尝试对我创建的单个制表符分隔的西班牙语-英语单词列表进行同源分析。该列表名为 SE.lxs,如下所示:
ID Words Spanish
1 dog pero
2 cat gato
3 water agua
4 table meza
5 hand mano
6 red rojo
7 blue azul
8 green verde
9 person persona
10 girl chica
我认为这是此处定义的适当格式:http: //lingulist.de/lingpy/docu/lingpy.lexstat.LexStat.html
但是,当我运行命令时:
lex = LexStat(get_file('C:\Python27\SE.lxs'))
我收到以下错误:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
lex = LexStat(get_file('C:\Python27\SE.lxs'))
File "C:\Python27\lib\site-packages\lingpy-1.0.1-py2.7-win32.egg\lingpy\lexstat.py", line 62, in __init__
self._init_lxs(infile)
File "C:\Python27\lib\site-packages\lingpy-1.0.1-py2.7-win32.egg\lingpy\lexstat.py", line 278, in _init_lxs
txt = array(loadtxt(infile),dtype="str")
File "C:\Python27\lib\site-packages\lingpy-1.0.1-py2.7-win32.egg\lingpy\algorithm\misc.py", line 454, in loadtxt
f = open(infile)
IOError: [Errno 22] invalid mode ('r') or filename: 'C:\\Python27\\lib\\site-packages\\lingpy-1.0.1-py2.7-win32.egg\\lingpy\\test/tests/lxs/C:\\Python27\\SE.lxs'
可以在这里找到问题的图片:http: //i.imgur.com/XdLig.png