Skip to content

Reduce all duplicated spaces#211

Open
davy-tw wants to merge 1 commit intochewing:masterfrom
davy-tw:fix/reduce_spaces_in_bopomofo
Open

Reduce all duplicated spaces#211
davy-tw wants to merge 1 commit intochewing:masterfrom
davy-tw:fix/reduce_spaces_in_bopomofo

Conversation

@davy-tw
Copy link
Member

@davy-tw davy-tw 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

@davy-tw davy-tw changed the title Fix #204 Reduce all duplicated spaces Apr 10, 2017
@davy-tw davy-tw 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.
@davy-tw davy-tw 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