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

feat: TitleCase enhancement #28

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

opanitch
Copy link

@opanitch opanitch commented Aug 4, 2023

Status

DONE

Description

enhancement changes requested in issue #27 for TitleCase

  • Updates TitleCase
  • Update Tests for TitleCase

Type of Change

✨ New feature (non-breaking change which adds functionality)

@opanitch opanitch changed the title Titlecase enhancement feat: TitleCase enhancement Aug 4, 2023
@gorehamt
Copy link

I am commenting on this to give it more visibility. It would be nice if this PR could be merged and this shortcoming could be fixed. Articles and prepositions should not be capitalized in titles according to the APA guidelines. Thanks!

lib/recase.dart Outdated
Comment on lines 151 to 152
!isFirstWord && punctuationList.indexOf(words[word.key - 1]) > 0;
var isExcluded = exclusionListEng.indexOf(word.value) > 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!isFirstWord && punctuationList.indexOf(words[word.key - 1]) > 0;
var isExcluded = exclusionListEng.indexOf(word.value) > 0;
!isFirstWord && punctuationList.contains(words[word.key - 1]);
var isExcluded = exclusionListEng.contains(word.value);

I think you should use contains, because indexOf(...) > 0 will return false if the value is the first element in the list, but it should be true for that case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 👍🏼

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.

3 participants