狐猴在尝试索引文件时出现格式错误的文档错误
我在这里浏览了一些狐猴索引教程:
http://www .lemurproject.org/tutorials/begin_indexing-1.php
我创建了一个“语料库”文件夹,其中包含一个具有看似格式正确的文件的文档:
<DOC>
<DOCNO>1</DOCNO>
<TEXT>
Here is some text
</TEXT>
</DOC>
并创建了以下配置文件:
<parameters>
<corpus>
<path>C:\Users\Tristan\Documents\lemur\corpus</path>
<class>trectext</class>
</corpus>
<memory>256m</memory>
<index>C:\Users\Tristan\Documents\lemur\index</index>
</parameters>
但是,当我运行时
IndriBuildIndex.exe C:\Users\Tristan\Documents\lemur\config\parameter.xml
:得到一个神秘的异常:
0:00: Opened repository C:\Users\Tristan\Documents\lemur\index
0:00: Opened C:\Users\Tristan\Documents\lemur\corpus\1
0:00: Error in C:\Users\Tristan\Documents\lemur\corpus\1 : .\src\TaggedDocumentI
terator.cpp(213): Malformed document: C:\Users\Tristan\Documents\lemur\corpus\1
0:00: Closing index
0:00: Finished
我查看了源代码中的相关函数,但没有什么特别的地方让我注意到。有什么想法吗?
I've been going through a bit of the lemur indexing tutorial here:
http://www.lemurproject.org/tutorials/begin_indexing-1.php
I've created a "corpus" folder, containing one document with the seemingly properly formatted file:
<DOC>
<DOCNO>1</DOCNO>
<TEXT>
Here is some text
</TEXT>
</DOC>
and created the following configuration file:
<parameters>
<corpus>
<path>C:\Users\Tristan\Documents\lemur\corpus</path>
<class>trectext</class>
</corpus>
<memory>256m</memory>
<index>C:\Users\Tristan\Documents\lemur\index</index>
</parameters>
However, when I run:
IndriBuildIndex.exe C:\Users\Tristan\Documents\lemur\config\parameter.xml
I get the cryptic exception:
0:00: Opened repository C:\Users\Tristan\Documents\lemur\index
0:00: Opened C:\Users\Tristan\Documents\lemur\corpus\1
0:00: Error in C:\Users\Tristan\Documents\lemur\corpus\1 : .\src\TaggedDocumentI
terator.cpp(213): Malformed document: C:\Users\Tristan\Documents\lemur\corpus\1
0:00: Closing index
0:00: Finished
I looked at the relevant functions in the source, but nothing in particular jumps out at me. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终以 unix 格式保存了我的文档文件并且它起作用了。但请注意,由于某种原因,手动修复行结尾不起作用,因此 Windows 向文件中添加了狐猴不喜欢的其他内容。
I ended up saving my document file in unix format and it worked. Note however, that for some reason manually fixing the line endings didn't work, so there is something else windows adds to files than lemur doesn't like.