| Crates.io | harper-core |
| lib.rs | harper-core |
| version | 1.5.1 |
| created_at | 2024-01-21 03:18:12.242406+00 |
| updated_at | 2026-01-22 22:34:28.892569+00 |
| description | The language checker for developers. |
| homepage | |
| repository | https://github.com/automattic/harper |
| max_upload_size | |
| id | 1107227 |
| size | 6,077,612 |
harper-coreharper-core is the fundamental engine behind Harper, the private grammar checker.
harper-core is available on crates.io to enable Rust engineers to integrate high-quality grammar checking directly into their apps and workflows.
Feel free to use harper-core in your projects.
If you run into problems with the code, open an issue or, even better, create a pull request.
We are also happy to chat with you on Discord.
The documentation for harper-core is available online.
If you would prefer to run Harper from inside a JavaScript runtime, we have a package for that as well.
Here's what a full end-to-end linting pipeline could look like using harper-core.
use harper_core::linting::{LintGroup, Linter};
use harper_core::parsers::PlainEnglish;
use harper_core::spell::FstDictionary;
use harper_core::{Dialect, Document};
let text = "This is an test.";
let parser = PlainEnglish;
let document = Document::new_curated(text, &parser);
let dict = FstDictionary::curated();
let mut linter = LintGroup::new_curated(dict, Dialect::American);
let lints = linter.lint(&document);
for lint in lints {
println!("{:?}", lint);
}
concurrent: Whether to use thread-safe primitives (Arc vs Rc). Disabled by default.
It is not recommended unless you need thread-safely (i.e. you want to use something like tokio).