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.
- Implemented
CHECKCOMPOUNDPATTERNreplacements 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 hasherSinstead of being implemented only for the default hasher.
- Fixed a panic in
Dictionary::addwhen given an input longer thanu16::MAXbytes. It now returnsParseFlagError::WordTooLong(a new variant), matching the check the.dicfile parser already applied. - Fixed incorrect checking of
SIMPLIFIEDTRIPLEcompound 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 examplebuskiagainst a dictionary usingCHECKCOMPOUNDTRIPLEandSIMPLIFIEDTRIPLE). NOSPLITSUGSis 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 numwith anAFalias 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 throughAFaliases, reported every suffixed word as misspelled.
- Reduced allocations in the affix-stripping hot path by writing candidate stems
into a reused buffer instead of allocating a
Stringfor each stripped affix. - Avoided redundant comparisons when stemming a word by slicing off an already-matched prefix or suffix instead of re-stripping it.
AffixesIternow 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.
- 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
categoriesanddocs.rsmetadata so the documentation on docs.rs is built with all features.
- Fixed
PFX/SFXrules with cross-product set toNbeing 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
CHECKCOMPOUNDREPpatterns.
- 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.or1,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.
- Sped up
ICONV/OCONVinput/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.
- Fixed string slicing panic when checking a word with non-ASCII text when the
dictionary has
CHECKCOMPOUNDPATTERNrules. - Fixed bug in suggestions using
MAPrules which would cause suggestions to take a very long time to compute in dictionaries withMAPrules. (#14)
- Added
spellbook::Dictionary::remove_stem. This acts the same asHunspell::remove. (#11)
- 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 dictionariesen_GB. - Version requirements on Hashbrown and Foldhash have been loosened.
- 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
REPpatterns with end anchors (i.e. the first word afterREPends in$) which also setsCHECKCOMPOUNDREPand other related compounding rules.
- This panic could happen in dictionaries which used
- 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éxin a french dictionary which has aREP è$ erule.
- For example
- Aligned parsing of flags with Hunspell. This fixes cases where a dictionary would
use non-ASCII characters for flags without setting
FLAG UTF-8.
- Fixed handling of Unicode flags which are represented by more than one code unit in UTF-16 representation, for example emoji such as '🔭'.
- Exposed the
Checkertype. - Added
Checker::check_lower_as_titleandChecker::check_lower_as_upperto configure the checker to try lowercase words as title and/or uppercase.
- Added support for
Dictionary::suggestand theSuggestertype.
- Changed the internal representation of word stems and flagsets for reduced memory consumption. More...
- Initial support for
Dictionary::new,Dictionary::checkandDictionary::add