Skip to content

Commit

Permalink
Merge pull request #1405 from Shreeshrii/patch-2
Browse files Browse the repository at this point in the history
Add additional Unicodes to IsVedicAccent
  • Loading branch information
zdenop authored Apr 13, 2018
2 parents c869478 + 198664f commit 83f311f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion training/validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ bool Validator::IsVirama(char32 unicode) {
// Returns true if the given UTF-32 unicode is a vedic accent.
/* static */
bool Validator::IsVedicAccent(char32 unicode) {
return 0x1cd0 <= unicode && unicode < 0x1d00;
return 0x1cd0 <= unicode && unicode < 0x1d00 ||
0xa8e0 <= unicode && unicode <= 0xa8f7 ||
0x951 <= unicode && unicode <= 0x954;
}

// Returns true if the script is one that uses subscripts for conjuncts.
Expand Down

4 comments on commit 83f311f

@nguyenq
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe several enclosing parentheses are missing, as follows:

return (0x1cd0 <= unicode && unicode < 0x1d00) ||
          (0xa8e0 <= unicode && unicode <= 0xa8f7) ||
          (0x951  <= unicode && unicode <= 0x954);

@Shreeshrii
Copy link
Collaborator

Choose a reason for hiding this comment

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

@nguyenq Quite possible, I am not sure of c++ syntax. Characters from all three ranges should be treated as a Vedic accent.

@zdenop
Copy link
Contributor Author

@zdenop zdenop commented on 83f311f Apr 14, 2018

Choose a reason for hiding this comment

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

can you send please PR that fix it?

@amitdo
Copy link
Collaborator

@amitdo amitdo commented on 83f311f Apr 15, 2018

Choose a reason for hiding this comment

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

I believe several enclosing parentheses are missing, as follows:

I think both versions will work the same.

http://en.cppreference.com/w/cpp/language/operator_precedence

Still, the added parentheses can make it more readable.

Please sign in to comment.