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

Reduce all duplicated spaces #211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

david50407
Copy link
Member

@david50407 david50407 commented Apr 10, 2017

Fixed #204, replacing all duplicated spaces (included single tab and tabs) into single space.

I move testBopomofo method from UserphraseModel into a new util BopomofoUtil, IMO, this function is not that related to the model.
And we can create tests for this more easily (without including the main program).

cc @jserv @czchen

@david50407 david50407 changed the title Fix #204 Reduce all duplicated spaces Apr 10, 2017
@david50407 david50407 force-pushed the fix/reduce_spaces_in_bopomofo branch from 7e9950b to 06f65f7 Compare April 10, 2017 03:17
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 95.082% when pulling 06f65f7 on david50407:fix/reduce_spaces_in_bopomofo into 1679266 on chewing:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 95.082% when pulling 06f65f7 on david50407:fix/reduce_spaces_in_bopomofo into 1679266 on chewing:master.

@jserv
Copy link
Member

jserv commented Apr 11, 2017

Improve the subject of Git commit message. At least, summarize the work first.

TEST_F(TestBopomofoUtil, ReduceDuplicatedSpacesInsideBopomofo)
{
ASSERT_EQ(0, QString::compare("ㄘㄜˋ ㄕˋ", BopomofoUtil::normalize("ㄘㄜˋ ㄕˋ")));
ASSERT_EQ(0, QString::compare("ㄘㄜˋ ㄕˋ", BopomofoUtil::normalize("ㄘㄜˋ ㄕˋ")));

Choose a reason for hiding this comment

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

Should this test also including the test of replacing "一" to "ㄧ" and "丫" to "ㄚ"?
This commit cover this feature, too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nop, this PR is just moving the original part of replacing ambugity words into a sperated file and adding the reducing duplicated spaces function.

But, yes, we still need tests for replacing ambugity words, that's why I move it. After this PR, I'll submit another PR for the tests.

Fixed chewing#204.

Move `testBopomofo` method from UserphraseModel into BopomofoUtil for testing.
@david50407 david50407 force-pushed the fix/reduce_spaces_in_bopomofo branch from 06f65f7 to 22a954f Compare April 17, 2017 15:39
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.

4 participants