Skip to content

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