harper/harper-core
Andrew Dunbar 69db96b370
chore: add weigh/weight to noun/verb confusion (#2315)
* chore: add weigh/weight to noun/verb confusion

* fix: -debug printf
2025-12-10 21:52:07 +00:00
..
benches feat(core): create SplitWords linter (#2118) 2025-10-29 16:43:17 -06:00
src chore: add weigh/weight to noun/verb confusion (#2315) 2025-12-10 21:52:07 +00:00
tests feat(core): create rule to title-case headings (#2297) 2025-12-05 20:35:00 +00:00
annotations.json feat(core): create rule to detect incorrect verbs in nominal phrase (#2176) 2025-11-13 15:32:54 -07:00
Cargo.toml build(deps): bump unicode-script from 0.5.7 to 0.5.8 (#2305) 2025-12-08 15:25:53 +00:00
clippy.toml Added long_sentences and changed linter API 2024-01-20 19:43:59 -07:00
dictionary.dict chore: add weigh/weight to noun/verb confusion (#2315) 2025-12-10 21:52:07 +00:00
irregular_nouns.json Irregular verbs (#2285) 2025-12-08 16:30:04 +00:00
irregular_verbs.json Irregular verbs (#2285) 2025-12-08 16:30:04 +00:00
proper_noun_rules.json feat(core): more rules (#2107) 2025-11-05 08:27:25 -07:00
README.md hotfix(core): properly format example 2025-12-09 11:40:02 -07:00

harper-core

harper-core is the fundamental engine behind Harper, the grammar checker for developers.

harper-core is available on crates.io. However, improving the API is not currently a high priority. Feel free to use harper-core in your projects. If you run into issues, create a pull request.

Example

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);
}

Features

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).