fix(simplifier): handle OpenCC converters without conversion chains#1184
Open
n19htfall wants to merge 1 commit into
Open
fix(simplifier): handle OpenCC converters without conversion chains#1184n19htfall wants to merge 1 commit into
n19htfall wants to merge 1 commit into
Conversation
|
已经应用到 Arch Linux 的 librime 包中,测试有效。谢谢! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
問題
#1185
OpenCC 1.3.2 的
t2s.json包含 normalization,因此Config::NewFromFile()會建立PipelineConverter。PipelineConverter::GetConversionChain()按設計返回nullptr,但 simplifier 會直接解引用其結果,導致啟用簡體轉換時發生 SIGSEGV。修改
GetConversionChain()返回nullptr的情況。ConvertWord()返回false,讓Simplifier::Convert()回退至ConvertText()。ConvertText()繼續透過converter_->Convert()完成轉換。