hchunhui / librime-lua

Extending RIME with Lua scripts
BSD 3-Clause "New" or "Revised" License
309 stars 43 forks source link

dictiter_lookup 方法不支持检索词组 #369

Open boomker opened 1 week ago

boomker commented 1 week ago

如下代码:

        local word_yin_code = input:sub(1, 4)
        local wd = env.mem:dictiter_lookup(word_yin_code, true, 50) -- expand_search
        for entry in wd:iter() do
            local et = entry.text
            logger.writeLog("xx: " .. et)
        end

发现日志里没有打印出词典里的词组,可以打印出单字,这是为什么呢,是姿势不对,还是说本来就不支持 @shewer ,大佬有空帮忙指点一下,多谢🙏

shewer commented 1 week ago

看不出有什麼問題,會不會是 word_yin_code 的字根 沒有詞組 或是 權重排不上 50個之內

Dictionary::LookupWords () 會經過 prism 轉換再查 table 字典 如果 prism 轉換出多套字根 再去查table 說不定 50個不夠

boomker commented 6 days ago

我用的是双拼,两个编码字符为音码,比如 输入 uiui 会出现二字词组,我现在想按下 /xy后, 过滤词组中形码包含xy 条目