feat(engine): 直接辅助码句中四码可用第二位辅码大写结束 (#630)
直接辅助码的四码在句中原来只能补 / 结束(uiab/),现在也可以把第二位辅码敲成大写(uiaB)。 设置页「直接辅助码句中四码标记」两个勾选框可多选、至少留一个,默认只勾 /。 - 引擎:拼写图新增 Aux2Upper(非缩写)。开着大写标记时大写字母只能当第二位辅码, 走不通再退回不分大小写的旧规则,第一位辅码敲大写(uiAuiQ)照常可用。/ 的收键受勾选控制。 - 协议:DirectHelpcodeChanged 载荷改为 "0"/"1"/"2"(2 = 开着但 / 不是编码键), TSF 据此决定吃不吃 /。 - 配置:新增 helpcode.shuangpin_direct_helpcode_slash / _uppercase,同步写入出厂模板、 工作配置和两个设置宿主的读写映射。
This commit is contained in:
1 parent
3c79876205
commit
53ee180ec3
29 files changed
+347
-45
No files matched your search
@@ -203,14 +203,25 @@ bool Resolver::resolve(QueryRequest &request, const ResolveContext &context)
|
||||
aux_index_built_ = false;
|
||||
indexed_keymap_ = context.keymap;
|
||||
}
|
||||
SpellingOptions spelling_options;
|
||||
spelling_options.slash_marker = request.direct_helpcode_slash_marker;
|
||||
spelling_options.uppercase_marker = request.direct_helpcode_uppercase_marker;
|
||||
if (spelling_options != spelling_options_)
|
||||
{
|
||||
// 同一个原串换了四码标记就是另一张拼写图,按原串记的切分作废。
|
||||
resolution_cache_.clear();
|
||||
spelling_options_ = spelling_options;
|
||||
}
|
||||
|
||||
auto cached = resolution_cache_.find(typed);
|
||||
if (cached == resolution_cache_.end())
|
||||
{
|
||||
const auto graph =
|
||||
build_spelling_graph(typed, profile_, [&](const std::string &quanpin, char first, char second) {
|
||||
const auto graph = build_spelling_graph(
|
||||
typed, profile_,
|
||||
[&](const std::string &quanpin, char first, char second) {
|
||||
return has_aux(quanpin, first, second, context);
|
||||
});
|
||||
},
|
||||
spelling_options_);
|
||||
Resolution resolution;
|
||||
// 只有一条完整切分时没有可比的切法,跳过整句解码;整句留给词典层自己的词格去解。
|
||||
if (!graph.empty() && !single_path(graph, resolution.spellings))
|
||||
|
||||
Reference in new issue
Block a user