Lucene 中两个文件之间的差异
在 C# 的 Lucene 中,我试图找出索引是否包含重复的文件或几乎相同的文件,以查看是否需要用新文件替换它。为此,我想出了一种方法,可能是使用 MoreLikeThis 类,然后获取相关文档的列表。然后比较这些相关文档,看看它们是否与我添加的文档匹配——比如 90% 匹配。然后程序会询问用户这两个是否重复以及保留哪一个。
- 可以使用 Lucene 来完成吗? ...这是最好的方法吗?
- 如果无法做到这一点,则使用 Levenshtein 距离算法 是比较两个文件的最有效方法看看他们是否有类似的比赛?
谢谢!
In Lucene in C# I am trying to find out if the index contains duplicate files or almost identical to see if it needs to be replaced with the new file. To do this I have figured a way of doing it might be to use the MoreLikeThis class, then get a list of related documents. Then after compare these related documents to see if they match the document I am adding in—say a 90% match. The program will then ask if the user if the two are duplicates and which one to keep.
- Can this be done using Lucene? ...and is this the best way to go about doing it?
- If this can't be done, is using the Levenshtein Distance Algorithm the most efficient way of comparing two files to see if they have a similar match?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了与 lucene 比较文档,您还可以使用 TermFreqVector 并将 TermVector 保存在索引中。您还可以使用此向量计算狄利克雷相似度。
for comparing documents with lucene you can also use TermFreqVector and saving TermVector in your index. Also you can compute Dirichlet similarity with this vecotr.