Skip to content
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

bug: "1s and 0s" flagged with "sand" suggested as fix #774

Open
hippietrail opened this issue Feb 25, 2025 · 1 comment
Open

bug: "1s and 0s" flagged with "sand" suggested as fix #774

hippietrail opened this issue Feb 25, 2025 · 1 comment
Assignees
Labels
bug Something isn't working harper-core linting

Comments

@hippietrail
Copy link
Contributor

hippietrail commented Feb 25, 2025

Description

Claude Shannon saw the world in 1s and 0s, Realizing they could represent words, sounds, images, even ideas.

Harper doesn't interpret "1s" and "0s" as nouns. It seems "1" and "0" as numbers despite their suffixes. It sees "s" and "and" as adjacent words.

We could add a lexer for suffixed numbers or just suffixed single digits that returns word type.

We'd have to take into account at least:

  1. the -s suffix on numbers can have other meanings, such as "seconds".
  2. people often use a -'s suffix for plurals for things like single letters, digits, acronyms, etc.

Actually can we add numbers to the curated dictionary? Wouldn't make sense for most numbers or even the other single digits. I'll check this... OK it makes no difference. No tests fail but behaviour doesn't change. I think this is due to the lexical analysis having higher priority than the dictionary lookup? The numbers get lexed as numbers rather than words so there is no chance for 1s and 0s to be looked up in the dictionary.

Resources

If the problem is not obvious, some online resources clarifying the relevant grammar point can be useful.

Screenshots

Image Image
@hippietrail hippietrail added bug Something isn't working harper-core linting labels Feb 25, 2025
@hippietrail
Copy link
Contributor Author

I'm working on this one. Assign me if you read this before I submit the PR.

hippietrail added a commit to hippietrail/harper that referenced this issue Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working harper-core linting
Projects
None yet
Development

No branches or pull requests

1 participant