Skip to content

Dev0934 增加 ShadowCandidate UniquifiedCandidate#162

Merged
hchunhui merged 22 commits intohchunhui:masterfrom
shewer:dev0934
Jul 11, 2022
Merged

Dev0934 增加 ShadowCandidate UniquifiedCandidate#162
hchunhui merged 22 commits intohchunhui:masterfrom
shewer:dev0934

Conversation

@shewer
Copy link
Copy Markdown
Contributor

@shewer shewer commented Feb 18, 2022

可解決SimpleCandidate commit 無法更新user_dictionary 問題

ShadowCandidate(cand,type,text,comment)類似 simplifier 的作法
UniqifiedCandidate(cand,type,text,comment) 類似 uniqifier 的l作法

-- lua_filter
function func(input, env)
   for cand in input:iter() do
        if cand.text == "繁體" then 
              cand= Shadow(cand,"simp","繁体","","") -- (cand ,type,text,comment)
        end
        yield(cand)
   end
end
-- lua_filter@uniquified
function func(input,env)
   local tab={}
   for cand in input:iter() do 
     if tab[cand.text] then 
        tab[cnad.text]:append(cand)
     else
         tab[cand.text] = cand:to_uniquified_candadite("uniquified","","")
         yield(tab[cand.text])
     end
   end
end

shewer added 22 commits March 30, 2021 20:03
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
* add  EngineReg select_schema()  env.engine:select( string schema_id ) .next

Signed-off-by: shewer <shewer@gmail.com>

* add engine:apply_schema( Schema &)   Schema( const string &)

Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: shewer <shewer@gmail.com>
Signed-off-by: Shewer Lu <shewer@gmail.com>
Signed-off-by: Shewer Lu <shewer@gmail.com>
Signed-off-by: Shewer Lu <shewer@gmail.com>
Signed-off-by: Shewer Lu <shewer@gmail.com>
Signed-off-by: Shewer Lu <shewer@gmail.com>
Comment thread src/types.cc
{ "get_genuine", WRAP(T::GetGenuineCandidate) },
{ "get_genuines", WRAP(T::GetGenuineCandidates) },
{ "to_shadow_candidate", WRAP(shadow_candidate) },
{ "to_uniquified_candidate", WRAP(uniquified_candidate) },
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

to_shadow_candidateto_uniquified_candidate 是否写错,作为 method 为何与 ShadowCandidateUniquifiedCandidate 相同?

Copy link
Copy Markdown
Contributor Author

@shewer shewer Jul 11, 2022

Choose a reason for hiding this comment

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

to_shadow_candidate to_uniquified_candidate
調用 c api 是相 同 的 參數
只是方便 instance 使用 : 來調用
cand:to_shadow_candidate(type,text,comment)
和 Shadow_Candidate(cand,type,text,comment)
是同個恴思

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

明白了

@hchunhui hchunhui merged commit adadf92 into hchunhui:master Jul 11, 2022
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.

2 participants