Prevent Zero Width Joiner replaced with whitespace #630
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolve #629
Currently, the Zero Width Joiner character has been replaced by whitespace. Due to that Sinhala language that requires Zero Width Joiner getting altered and resulted in wong output.
Ideally, we shouldn't replace Zero Width Joiner (200D) with whitespace or empty since it indicates to join two chars without zero width(no whitespace). Also, It requires to present in order to decode the segmentation to raw test successfully. We should keep these special characters as it is.
This PR eliminate the places where WZJ has replaced with whitespace. after referrog to the commit [1],
data/nmt_nfkc.tsv
data/nmt_nfkc_cf.tsv
builder.cc
The even-though local build [2] was successful, unfortunately, src/normalization_rule.h didn't get updated, hence I couldn't able to apply my changes.
Appreciate it if anyone provides insight on this since I wanted to make it work for the Sinhala Language.
[1] 18c337f#diff-c0960ff1cd2e917394da837d2a75ca10e06abab61bbd2d36f174fa284c8d700bR57266
[2] https://github.com/google/sentencepiece#build-and-install-sentencepiece-command-line-tools-from-c-source