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

fix #652: process whole conversion chain #656

Closed
wants to merge 6 commits into from

Conversation

amorphobia
Copy link

  • continue to process whole conversion chain for whole candidate matching except for the candidate original form

Pull request

Issue tracker

Fixes #652

Unit test

  • Done

Manual test

  • Done

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

* continue to process whole conversion chain for whole candidate
matching except for the candidate original form
Comment on lines 253 to 259
string simplified;
const bool success_converted = opencc_->ConvertText(original->text(), &simplified);
if (success_converted && original->text().compare(simplified) != 0) {
PushBack(original, result, simplified);
} else {
PushBack(original, result, forms[i]);
}
Copy link
Author

@amorphobia amorphobia Jun 2, 2023

Choose a reason for hiding this comment

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

I have not tested your suggestion yet. I have a question. Would it lose results if a character can be converted into multiple ones?

For example, 「才」 would be converted to 「才」 and 「纔」, but it will use ConvertText first, get result 「才」 (or 「纔」, not test yet), and go to success branch. Then the result 「纔」 will lose.

Copy link
Member

@eagleoflqj eagleoflqj left a comment

Choose a reason for hiding this comment

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

Tested the example in #652 and it works fine.

@lotem
Copy link
Member

lotem commented Aug 9, 2023

不应重复转换

@eagleoflqj
Copy link
Member

@lotem is right. Should fix it in ConvertWord.

@eagleoflqj eagleoflqj closed this Aug 9, 2023
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.

OpenCC "conversion_chain" not fully working
4 participants