Repository navigation
Add offline spellchecking for visible interview text - #96
Merged
Merged
Conversation
Check questions, labels, help and template content against bundled Hunspell dictionaries (US English by default; Spanish, Russian and Swedish bundled; custom dictionaries supported) and report possible typos (WG701) and common legal misspellings (WG702) under a new "spelling" finding class. Enabled by default in the CLI and API; disable with --no-spellcheck or RuntimeOptions(spellcheck=None). Configure with --spellcheck-language, --spellcheck-dictionary, --spellcheck-wordlist, --spellcheck-ignore-word and --spellcheck-severity, or SpellcheckOptions in Python. Adds find_spelling_findings_from_string and scripts/evaluate_spelling.py for corpus evaluation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RLA-ES offers its dictionary under GPLv3+, LGPLv3+ or MPL 1.1+. Elect MPL 1.1 and drop the GPL/LGPL license texts and the upstream README that described those options, so the package does not imply GPL licensing. Declare the license as "MIT AND MPL-1.1" and ship the dictionary's license files in the wheel metadata. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fetch es_US.aff/.dic from a pinned LibreOffice dictionaries commit the first time Spanish is selected, verify their SHA-256 hashes, and cache them in the user cache directory ($DAYAMLCHECKER_CACHE_DIR, else $XDG_CACHE_HOME/dayamlchecker or %LOCALAPPDATA%). Later local runs reuse the cache; a corrupted cached file is fetched again. Download, hash and cache failures are configuration errors that suggest --spellcheck-dictionary es=PATH for offline use. The package no longer redistributes the dictionary, so it is plain MIT again. Tests keep the dictionary in pytest's cache and skip Spanish tests when offline, except under CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a local spellcheck pass for the visible text interview users see: questions, subquestions, field labels, help, choice labels, and template content. It skips code, stored values, Mako, Markdown/HTML markup, and URLs.
This brings DAYamlChecker closer to parity with the original linter script, which previously ran spelling checks.
spelling_possible_typo) and SP702 (spelling_common_legal_typo, such asjudgement→judgmentandHIPPA→HIPAA) under a newspellingfinding class. The codes remainSP701/SP702at every configured severity, so suppressions stay stable.--no-spellcheckorRuntimeOptions(spellcheck=None).--spellcheck-severity info|warning|errorchanges the reported level and exit behavior without changing the rule code. This lets new lint rules begin as warnings and become enforceable when a project is ready.en,es,ru, andsvare built in. Custom Hunspell dictionaries can be added with--spellcheck-dictionary LANG=PATH. Blocks with a declaredlanguageoutside the selected languages are skipped.--spellcheck-language,--spellcheck-wordlist,--spellcheck-ignore-word, and--spellcheck-severity, plusSpellcheckOptionsin Python. Findings can be suppressed with# no-dayccomments by code, message ID, or class.find_spelling_findings_from_stringandSpellcheckOptions.scripts/evaluate_spelling.pycompares results on a corpus of interviews.Licensing and dictionaries
Uses
spylls(MIT; pure-Python Hunspell) as a dependency. Its English, Russian, and Swedish dictionaries require no network access.The Spanish dictionary (RLA-ES, via LibreOffice) is not shipped, so the package remains plain MIT. The first run selecting
esdownloadses_US.affand.dic(about 850 KB) from a pinned LibreOffice commit and verifies their SHA-256 hashes. Files are cached under$DAYAMLCHECKER_CACHE_DIRwhen configured; otherwise the platform user-cache directory is used ($XDG_CACHE_HOME/dayamlchecker, normally~/.cache/dayamlchecker, or%LOCALAPPDATA%\dayamlchecker\cacheon Windows). Download failures point users to--spellcheck-dictionary es=PATHfor offline use.Notes for reviewers
--max-warnings 0may begin failing on spelling warnings because spellchecking is enabled by default.Testing
uv run pytest -q tests: 748 passed, 56 subtests passed.License-Expression: MIT.