操作转换实现(不是 javascript)

发布于 2024-10-02 21:52:59 字数 1539 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

意中人 2024-10-09 21:52:59

考虑 Google-Diff-Match-Patch - 用于纯文本的 Diff、Match 和 Patch 库:

“Diff Match 和 Patch 库提供了强大的算法来执行同步纯文本所需的操作。”

差异:比较两个纯文本块并有效返回差异列表。

差异演示
匹配:给定一个搜索字符串,在纯文本块中找到其最佳模糊匹配。针对准确性和位置进行加权。

比赛演示
补丁:将补丁列表应用到纯文本上。即使底层文本不匹配,也要尽力应用补丁。

补丁演示
目前支持 Java、JavaScript、C++、C#、Objective C、Lua 和 Python。无论使用哪种语言,每个库都具有相同的 API 和相同的功能。所有版本还具有全面的测试工具。

您可以在此处找到它。

Consider Google-Diff-Match-Patch - Diff, Match and Patch libraries for Plain Text:

"The Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronizing plain text."

Diff: Compare two blocks of plain text and efficiently return a list of differences.

Diff Demo
Match: Given a search string, find its best fuzzy match in a block of plain text. Weighted for both accuracy and location.

Match Demo
Patch: Apply a list of patches onto plain text. Use best-effort to apply patch even when the underlying text doesn't match.

Patch Demo
Currently available in Java, JavaScript, C++, C#, Objective C, Lua and Python. Regardless of language, each library features the same API and the same functionality. All versions also have comprehensive test harnesses.

You can find it here.

赢得她心 2024-10-09 21:52:59

考虑一下 Py-infinote。

py-infinote 是 JInfinote 的 python 端口,提供协作文本编辑协议(adOPTed),可用于编写多用户协作文本编辑器。 Py-infinote 用于 HWIOS 项目。

https://github.com/sveith/jinfinote

Consider Py-infinote.

py-infinote is a python port of JInfinote, offering a collaborative text-editing protocol(adOPTed) which can be used to write multi-user collaborative text editors. Py-infinote is used in the HWIOS project.

https://github.com/sveith/jinfinote

如痴如狂 2024-10-09 21:52:59

这是另一个非常有趣的实现,将 google wave 的操作转换与 jedit 集成:

https://github.com/djspiewak/cccp

This is another quite interesting implementation integrating google wave's operational transform with jedit:

https://github.com/djspiewak/cccp

风吹短裙飘 2024-10-09 21:52:59

OpenCoweb 是一种流行的 OT 实现。有多种用不同语言编写的服务器实现。

OpenCoweb is a popular OT implementation. There are several server implementations written in different languages.

贱贱哒 2024-10-09 21:52:59

简单的参考实现,我将在接下来的几个月中通过添加更复杂的东西来改进;

现在它具有:

  • 简单的文本操作;保留、插入、删除及其相互转换
  • 对文本进行注释和转换
  • 生成更改并将其应用到文本

https ://github.com/slevental/operational-transformation

Simple reference implementation which I will be improving next few months by adding more complex stuff;

Now it has:

  • simple text operations; retain, insert, delete and their transformations against each other
  • annotations over text and transformations
  • generation of changes and applying them to text

https://github.com/slevental/operational-transformation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文