Skip to main content

Crate hyprcorrect_core

Crate hyprcorrect_core 

Source
Expand description

Core logic for hyprcorrect: configuration, the keystroke buffer, replacement planning, and the correction-provider interface.

This crate has no GUI or platform dependencies. See DESIGN.md at the repository root for the architecture.

Re-exports§

pub use buffer::Buffer;
pub use buffer::Key;
pub use buffer::NearbyWord;
pub use buffer::Sentence;
pub use buffer::SentenceAtCaret;
pub use buffer::WordAtCaret;
pub use chord::Chord;
pub use chord::ChordError;
pub use config::Behavior;
pub use config::Config;
pub use config::ConfigError;
pub use config::DefinitionSource;
pub use config::Hotkeys;
pub use config::LanguageToolConfig;
pub use config::LlmConfig;
pub use config::Privacy;
pub use config::ProviderId;
pub use config::Providers;
pub use config::ResetKeys;
pub use definitions::define;
pub use definitions::define_online;
pub use languagetool::LanguageToolError;
pub use languagetool::LanguageToolProvider;
pub use llm::LlmError;
pub use llm::LlmProvider;
pub use providers::Context;
pub use providers::Correction;
pub use providers::CorrectionProvider;
pub use providers::OfflineProvider;
pub use replace::Edit;
pub use replace::plan_word_replacement;

Modules§

buffer
The keystroke buffer: a bounded, in-memory record of recently typed text in the focused element. It lets hyprcorrect answer “what was the last word?” without reading back from the focused application — which is what makes correction work in terminals.
chord
A keyboard chord: a set of modifiers plus a single non-modifier key. Stored in config.toml as a +-separated uppercase string (CTRL+SHIFT+ALT+SUPER+F); parsed everywhere it’s used.
config
Configuration: loading and saving config.toml, plus the hotkey, provider, behavior, and privacy settings it holds.
definitions
Word definitions for the review popup’s suggestion dropdown.
languagetool
LanguageTool HTTP correction provider (M5).
llm
LLM-backed correction provider (M4).
providers
The correction-provider interface and the bundled offline provider.
replace
Replacement planning: turning a chosen correction into a concrete edit — a backspace count, a delete count, and the text to type — over the buffered text.
runtime
Runtime coordination between the daemon and the prefs subprocess.
secrets
Secret storage via the OS keychain.

Functions§

version
hyprcorrect’s version string, surfaced by the CLI and the About pane.