+
Skip to content

Add spell command #761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: trunk
Choose a base branch
from
Draft

Add spell command #761

wants to merge 13 commits into from

Conversation

vinc
Copy link
Owner

@vinc vinc commented Jul 14, 2025

A spellchecker is pretty useful when you start to write a lot of text.

@vinc
Copy link
Owner Author

vinc commented Jul 14, 2025

> spell example.txt
Error: Unknown word at example.txt:0:20

The quick brown fox jomp over the lazy dog.
                    ^^^^

@vinc
Copy link
Owner Author

vinc commented Jul 14, 2025

This PR will need #760 to be able to download the large dictionary files.

@vinc
Copy link
Owner Author

vinc commented Jul 14, 2025

> spell example.txt --verbose
Error: Unknown word "jomp" at example.txt:1:21
-----> Did you mean "jump"?

The quick brown fox jomp over the lazy dog.
                    ^^^^

@vinc
Copy link
Owner Author

vinc commented Jul 15, 2025

Dictionary lookup went from O(n) to O(log n) with the new data structure.

@vinc
Copy link
Owner Author

vinc commented Jul 16, 2025

It was easier to rewrite the little parser from scratch than finding the right way to parse the equivalent of /[a-Z]+('?[a-Z])*/ with chumsky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载