有没有一种方法可以逐句而不是逐行比较文件? [英] Is there a way to diff files sentence-by-sentence instead of line-by-line?

查看:90
本文介绍了有没有一种方法可以逐句而不是逐行比较文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是试图让diff更好地处理某些类型的文档。例如,使用LaTeX,我可能会有一个很长的段落,严格来说只是一行,但是如果只更改一个句子,我不想看到整个段落。特别是当我运行某种版本控制并且一位共同作者编辑与我相同的段落(但句子不相同)时。我不想让它显示为冲突。

Just trying to get diff to work better for certain kinds of documents. With LaTeX, for example, I might have a long paragraph that is strictly just one line, but I don't want to see that entire paragraph if just a sentence is changed. Particularly if I'm running some kind of version control and a co-author edits the same paragraph (but not the same sentence) as me. I wouldn't want that to show up as a conflict.

这是第二个问题。主要问题是我是否可以使用diff逐句查看。谢谢。

That's a secondary question. The main question is whether I can use diff to look sentence-by-sentence. Thanks.

编辑

wdiff 几乎是完美的。但是是否有合并等效项,如 diff diff3 一样?

wdiff is almost perfect. But is there a merge equivalent, as diff has with diff3?

推荐答案

wdiff 将为您提供逐字差异,而不是逐行。我不知道任何逐句差异程序。

wdiff will give you a word-by-word diff instead of line-by-line. I'm not aware of any sentence-by-sentence diff programs.

这篇关于有没有一种方法可以逐句而不是逐行比较文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆