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

fix(toEnglish): properly detect word boundaries #177

Merged
merged 2 commits into from
Nov 3, 2020

Conversation

bhajneet
Copy link
Member

@bhajneet bhajneet commented Nov 2, 2020

Fixes #175

Summary

Found this bug while @Harjot1Singh was working on single word translits in presenter

Tests for unexpected behavior

All old tests pass, as do these new ones:

  [ 'ਹਰਿ', 'har' ],
  [ 'ਸਚੁ', 'sach' ],
  [ 'ਰਾਹੁ', 'raahu' ],
  [ 'ਭਾਉ', 'bhaau' ],
  [ 'ਸਤਿਗੁਰੁ ਸਤਿਗੁਰੁ ਸਚੁ; ਸਚੁ ਹਰਿ ਹਰਿ ਹਿੰਙੁ', 'satigur satigur sach; sach har har hing' ],
  [ 'ਸੁ ਉ ਜੁ', 'su u ju' ],

Time spent on PR

one hour

Reviewers

@Harjot1Singh @sarabveer

@bhajneet bhajneet added ○ Type Bug Regressions/production issues that do not function as intended. Effort 1 Simple task (code/non-code). Impacts Some Affects the average end-user. labels Nov 2, 2020
@coveralls
Copy link

coveralls commented Nov 2, 2020

Pull Request Test Coverage Report for Build 342366396

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 342119814: 0.0%
Covered Lines: 153
Relevant Lines: 153

💛 - Coveralls

Copy link
Member

@Harjot1Singh Harjot1Singh left a comment

Choose a reason for hiding this comment

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

Looks good to me and the test case coverage is sufficient. @sarabveer if you can take a look today to confirm, that'd be good, I'll merge at EOD.

@Harjot1Singh Harjot1Singh changed the title fix: properly detect word boundary in toEnglish fix(toEnglish): properly detect word boundaries Nov 2, 2020
Copy link
Collaborator

@sarabveer sarabveer left a comment

Choose a reason for hiding this comment

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

[ new RegExp( `(\\S[^ਹ])([ਿੁ])([\\s$${vishraams.join( '' )}])`, 'ug' ), '$1$3' ], // Remove trailing ੁ and ਿ except when on ਹ or on a standalone akhar

This would also need to be updated.

@bhajneet
Copy link
Member Author

bhajneet commented Nov 3, 2020

Since you implemented that and we are not quite fluent in it, perhaps you can propose something more concrete/actionable?

Else you can file an issue and do it later

@bhajneet
Copy link
Member Author

bhajneet commented Nov 3, 2020

[ new RegExp( `(\\S[^ਹ])([ਿੁ])([\\s$${vishraams.join( '' )}])`, 'ug' ), '$1$3' ], // Remove trailing ੁ and ਿ except when on ਹ or on a standalone akhar

This would also need to be updated.

Perhaps best to open a new issue for you to work on, I don't know how to fix the tests on this

image

Please allow this PR to be merged in for the time being

@Harjot1Singh
Copy link
Member

Moved to #180 and releasing as is.

@Harjot1Singh Harjot1Singh merged commit 76925a6 into shabados:dev Nov 3, 2020
@bhajneet bhajneet deleted the bhajneet/issue175 branch January 11, 2022 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort 1 Simple task (code/non-code). Impacts Some Affects the average end-user. ○ Type Bug Regressions/production issues that do not function as intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toEnglish word endings not stripped correctly
4 participants