Harper:离线、隐私优先的英语语法检查器
英文标题:🔥 Automattic/harper
Automattic 开源了 Harper,一款以离线运行和隐私保护为核心的英语语法检查器,采用 Rust 构建。项目称,Harper 可在毫秒级完成文档检查,内存占用不足 LanguageTool 的 1/50,并可通过 WebAssembly 加载到网页中运行。Harper 目前仅支持英语,但其核心架构可扩展至其他语言;对于开发者而言,它提供了一个轻量、开源且无需将文本上传至服务器的语法检查方案。
49.1 KB
中文
Harper 是一款力求做到“恰到好处”的英语语法检查器。我在多年忍受竞品缺陷后创建了它。
Grammarly 价格过高,而且过度干预。它的建议缺乏上下文,且常常就是_错误的_。更不用说,它简直是一场隐私噩梦。你使用 Grammarly 写下的所有内容都会被发送到其服务器。其隐私政策声称不会出售这些数据,但这并不意味着它们不会用数据训练大语言模型,或进行其他天知道的用途。不仅如此,网络请求的往返延迟也使修改文本变得更加繁琐。
LanguageTool 很不错,前提是你有数 GB 的 RAM 可供使用,并且愿意下载约 16GB 的 n-gram 数据集。除了内存需求外,我还发现 LanguageTool 太慢:即使是对一个中等大小的文档进行 lint,也要花费数秒。
因此我创建了 Harper:它是一款符合我需求的语法检查器。它不仅能在毫秒级完成文档 lint,内存占用还不到 LanguageTool 的 1/50,并且完全保护隐私。
Harper 的体积甚至小到可以通过 WebAssembly 加载。
Harper 目前仅支持英语,但其核心可扩展以支持其他语言,因此欢迎能够带来其他语言支持的贡献。
我们认为较长的 lint 时间属于 bug。如果你遇到任何明显的性能问题,请就此创建 issue。
如果你找到了任何性能问题的修复方案,我们非常欢迎你提交贡献。但请务必先阅读我们的贡献指南。
没有所有贡献者的辛勤付出,这个项目不可能实现。
Harper 的 Logo 由 Lukas Werner 设计。
English / 原文
Harper is an English grammar checker designed to be just right. I created it after years of dealing with the shortcomings of the competition.
Grammarly was too expensive and too overbearing. Its suggestions lacked context, and were often just plain wrong. Not to mention: it's a privacy nightmare. Everything you write with Grammarly is sent to their servers. Their privacy policy claims they don't sell the data, but that doesn't mean they don't use it to train large language models and god knows what else. Not only that, but the round-trip-time of the network request makes revising your work all the more tedious.
LanguageTool is great, if you have gigabytes of RAM to spare and are willing to download the ~16GB n-gram dataset. Besides the memory requirements, I found LanguageTool too slow: it would take several seconds to lint even a moderate-size document.
That's why I created Harper: it is the grammar checker that fits my needs. Not only does it take milliseconds to lint a document, take less than 1/50th of LanguageTool's memory footprint, but it is also completely private.
Harper is even small enough to load via WebAssembly.
Harper currently only supports English, but the core is extensible to support other languages, so we welcome contributions that allow for other language support.
We consider long lint times bugs. If you encounter any significant performance issues, please create an issue on the topic.
If you find a fix to any performance issue, we would appreciate the contribution. Just please make sure to read our contribution guidelines first.
This project would not be possible without the hard work from those who contribute.
Harper's logo was designed by Lukas Werner.