hchunhui / librime-lua

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

add SegmenReg active_text(string) #329

Closed shewer closed 5 months ago

shewer commented 5 months ago

便於取得 substr , 減少 lua string.sub 定位問題 string.sub( inp, seg._start+1 , seg._end )

function tran.func(inp, seg, env)
    local active_inp = seg:active_text(inp)
     ....
 end