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

Stop converting punct when converting scripts #12

Merged
merged 1 commit into from
Nov 21, 2015

Conversation

jiru
Copy link
Contributor

@jiru jiru commented Nov 20, 2015

When converting from/to simplified/traditional, keep the punctuation chars
as-is. There should be no need to convert from Latin punctuation to Chinese
punctuation, so I removed that part.

Before the fix:

$ curl http://127.0.0.1:8042/trad?str=`php -r 'print urlencode("\"為-為什麼?\"");'`
<?xml version="1.0" encoding="UTF-8"?>
<root>
<trad><![CDATA[“為-為什麼?“]]></trad>
</root>

After the fix:

$ curl http://127.0.0.1:8042/trad?str=`php -r 'print urlencode("\"為-為什麼?\"");'`
<?xml version="1.0" encoding="UTF-8"?>
<root>
<trad><![CDATA["為-為什麼?"]]></trad>
</root>

When converting from/to simplified/traditional, keep the punctuation chars
as-is. There should be no need to convert from Latin punctuation to Chinese
punctuation, so I removed that part.
@@ -297,7 +286,7 @@ inline std::string Parser<T>::romanize_segment(int segmentNbr) {
if (tempItem != NULL) {
temp += tempItem->romanization;
} else {
temp += convert_trash_segment(segments[segmentNbr], true);
Copy link
Owner

Choose a reason for hiding this comment

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

shouln't it still be here for romanization (i.e Chinese -> Pinyin) conversion ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It’s still here, see the next line below. I only removed the second parameter.

Copy link
Owner

Choose a reason for hiding this comment

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

ok, i see. merged :)

allan-simon added a commit that referenced this pull request Nov 21, 2015
Stop converting punct when converting scripts
@allan-simon allan-simon merged commit 7d45d33 into allan-simon:master Nov 21, 2015
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.

2 participants