/pingji_adv_star.lua
https://code.google.com/p/google-pinyin-api/ · Lua · 44 lines · 29 code · 4 blank · 11 comment · 6 complexity · 789a40c2e6244ff3fd30a483fbbded00 MD5 · raw file
- -- encoding: UTF-8
- ------------------------------------------------
- -- ??????? ?? ???
- -- ??: 0.1.0.1
- -- ???Yichen Lu
- -- ?????http://yichenlu.cn/
- -- ????: http://code.google.com/p/google-pinyin-api/
- --
- -- ?????GPLv3??
- --
- ------------------------------------------------
- _YichenLu_Pingji_EMPTY = '?'
- _YichenLu_Pingji_FULL = '?'
- function YichenLu_Pingji_Adv(input)
- if #input > 0 then
- a=string.find(input, "/")
- if a==nil then
- b=tonumber(input)
- c=5
- else
- b=tonumber(string.sub(input,1, a-1))
- c=tonumber(string.sub(input,a+1))
- end
- if b>c then
- b=c
- end
- if b<0 then
- b=0
- end
- out=''
- for i=1,b do
- out = out .. _YichenLu_Pingji_FULL
- end
- for i=1,c-b do
- out = out .. _YichenLu_Pingji_EMPTY
- end
- return out
- end
- end
- ime.register_command("pj", "YichenLu_Pingji_Adv", "??", "none", "?? ??/?????????? 5?5/10 ? ??????????")