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

Remove camel case limit #653

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

Remove camel case limit #653

wants to merge 9 commits into from

Conversation

kaveeken
Copy link

The existing camel case limit (8) comes from the hard-coded length of SpellerImpl::check_inf. I changed the check function to no longer return when reaching the end of the array, instead reusing the last element of the array for all subsequent checks.

When a CompoundInfo * cpi is passed, reusing ci pointers means cpi->first_incorrect can change as well. Like the current implementation we return, setting cpi->count to zero.

The proposed change means we can accept large camel case words with correct spelling. Providing suggestions for incorrect spellings would require a different approach: making the check_inf array as well as some in suggest.cpp larger (this seems to work with minimal changes) or dynamically sized.

Things I still want to look at/change:

  • (re)using a placeholder object separate from the array
  • factoring out a check_camelcase function

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