Skip to content

Latest commit

 

History

History
178 lines (127 loc) · 6.78 KB

File metadata and controls

178 lines (127 loc) · 6.78 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Added

  • Implemented CHECKCOMPOUNDPATTERN replacements when checking compound words, bringing compound checking closer to Nuspell. Previously the replacement form of these patterns was not applied.
  • impl Debug for Dictionary<S> is now generic over the hasher S instead of being implemented only for the default hasher.

Fixed

  • Fixed a panic in Dictionary::add when given an input longer than u16::MAX bytes. It now returns ParseFlagError::WordTooLong (a new variant), matching the check the .dic file parser already applied.
  • Fixed incorrect checking of SIMPLIFIEDTRIPLE compound words. The simplified triple rule was applied at any compound boundary rather than only where a letter was actually doubled, so some non-words were wrongly accepted (for example buski against a dictionary using CHECKCOMPOUNDTRIPLE and SIMPLIFIEDTRIPLE).
  • NOSPLITSUGS is now honored: the suggester no longer proposes splitting a word into two when the dictionary sets this flag.
  • Fixed flag decoding for dictionaries that combine FLAG num with an AF alias table. A flag field is now resolved as an alias index rather than decoded as a literal numeric flag, so alias references expand correctly (matching Hunspell and Nuspell). Previously affected dictionaries such as Korean, whose suffix rules are referenced through AF aliases, reported every suffixed word as misspelled.

Performance

  • Reduced allocations in the affix-stripping hot path by writing candidate stems into a reused buffer instead of allocating a String for each stripped affix.
  • Avoided redundant comparisons when stemming a word by slicing off an already-matched prefix or suffix instead of re-stripping it.
  • AffixesIter now compares affixes by byte rather than by character, indexing directly into the word instead of walking the UTF-8 to the nth character.

Together these speed up checking of words with affixes, with the largest gains on affix-rich dictionaries such as French.

Changed

  • The published crate no longer includes the vendored dictionaries, tests, benchmarks, examples, or fuzz targets, substantially reducing its download size. The source remains available in the repository.
  • Added crates.io categories and docs.rs metadata so the documentation on docs.rs is built with all features.

[v0.4.2] - 2026-06-03

Fixed

  • Fixed PFX/SFX rules with cross-product set to N being treated as cross-product (Y). Previously the cross-product flag in the affix table was ignored, so prefixes and suffixes could be combined when the dictionary disallowed it.
  • Fixed several panics from slicing on non-character boundaries:
    • In the suggester when generating camel/pascal-case corrections for words with multi-byte characters.
    • In the checker when checking compound words against CHECKCOMPOUNDREP patterns.
  • Fixed KEY (keyboard) suggestions only considering the left neighbor of a key; the right neighbor is now also suggested.
  • Fixed forgotten-character suggestions not considering a missing character at the very end of the word (e.g. hell -> hello).
  • Fixed checking of multi-part compound words joined by COMPOUNDRULE.
  • Numbers with a trailing separator (e.g. 1. or 1,2,) are no longer classified as numeric.
  • The suggester now skips words strictly longer than MAX_WORD_LEN, matching the checker.
  • Overly long dictionary lines are now rejected during parsing instead of triggering a debug assertion, and the capacity hint from the dictionary file is capped to avoid excessive allocation on malformed input.

Performance

  • Sped up ICONV/OCONV input/output conversion by binary-searching the conversion table and adding fast lanes for common cases.
  • Added a fast lane for matching affix Conditions against literal characters.
  • Binary-search affixes in AffixesIter::next.

[v0.4.1] - 2026-05-25

Fixed

  • Fixed string slicing panic when checking a word with non-ASCII text when the dictionary has CHECKCOMPOUNDPATTERN rules.
  • Fixed bug in suggestions using MAP rules which would cause suggestions to take a very long time to compute in dictionaries with MAP rules. (#14)

[v0.4.0] - 2025-12-27

Added

  • Added spellbook::Dictionary::remove_stem. This acts the same as Hunspell::remove. (#11)

[v0.3.5] - 2025-09-12

Fixed

  • UTF-8 BOM characters are now stripped from dictionary text if present.
  • The # character is no special-cased as a comment, fixing parsing of some dictionaries en_GB.
  • Version requirements on Hashbrown and Foldhash have been loosened.

[v0.3.4] - 2025-04-30

Fixed

  • Fixed a panic similar to the one fixed in v0.3.3 but within the checker instead of the suggester.
    • This panic could happen in dictionaries which used REP patterns with end anchors (i.e. the first word after REP ends in $) which also sets CHECKCOMPOUNDREP and other related compounding rules.

[v0.3.3] - 2025-04-21

Fixed

  • Fixed a panic possible in the suggester when suggesting corrections for a word with non-ASCII characters near the end in dictionaries with replacement patterns with end anchors.
    • For example caféx in a french dictionary which has a REP è$ e rule.

[v0.3.2] - 2025-04-15

Fixed

  • Aligned parsing of flags with Hunspell. This fixes cases where a dictionary would use non-ASCII characters for flags without setting FLAG UTF-8.

[v0.3.1] - 2025-03-11

Fixed

  • Fixed handling of Unicode flags which are represented by more than one code unit in UTF-16 representation, for example emoji such as '🔭'.

[v0.3.0] - 2025-02-04

Added

  • Exposed the Checker type.
  • Added Checker::check_lower_as_title and Checker::check_lower_as_upper to configure the checker to try lowercase words as title and/or uppercase.

Changed

  • The default-hasher feature flag now uses foldhash instead of ahash.

[v0.2.0] - 2024-11-18

Added

  • Added support for Dictionary::suggest and the Suggester type.

Updated

  • Changed the internal representation of word stems and flagsets for reduced memory consumption. More...

[v0.1.0] - 2024-09-08

Added

  • Initial support for Dictionary::new, Dictionary::check and Dictionary::add