PageRenderTime 53ms CodeModel.GetById 16ms app.highlight 31ms RepoModel.GetById 2ms app.codeStats 0ms

/xuhao.lua

https://code.google.com/p/google-pinyin-api/
Lua | 232 lines | 202 code | 20 blank | 10 comment | 67 complexity | da73500eef308b48dd5552165e97ca84 MD5 | raw file
  1-- encoding: UTF-8
  2
  3------------------------------------------------
  4-- ????????????
  5-- ??: Mike
  6-- ??: 0.1
  7-- ????: http://code.google.com/p/google-pinyin-api/
  8--
  9-- ?????GPLv3??
 10------------------------------------------------
 11
 12function quan (input)
 13     if input == "a" then
 14             return {
 15            {["suggest"] = "a", ["help"] = "?"},
 16            {["suggest"] = "b", ["help"] = "?"},
 17            {["suggest"] = "c", ["help"] = "?"},
 18            {["suggest"] = "d", ["help"] = "?"},
 19            {["suggest"] = "e", ["help"] = "?"},
 20            {["suggest"] = "f", ["help"] = "?"},
 21            {["suggest"] = "g", ["help"] = "?"},
 22            {["suggest"] = "h", ["help"] = "?"},
 23            {["suggest"] = "a", ["help"] = "?"},
 24            {["suggest"] = "b", ["help"] = "?"},
 25       }
 26   end
 27end
 28
 29
 30function luoma (input)
 31     if input == "b" then
 32             return {
 33            {["suggest"] = "a", ["help"] = "?"},
 34            {["suggest"] = "b", ["help"] = "?"},
 35            {["suggest"] = "c", ["help"] = "?"},
 36            {["suggest"] = "d", ["help"] = "?"},
 37            {["suggest"] = "e", ["help"] = "?"},
 38            {["suggest"] = "f", ["help"] = "?"},
 39            {["suggest"] = "g", ["help"] = "?"},
 40            {["suggest"] = "h", ["help"] = "?"},
 41            {["suggest"] = "i", ["help"] = "?"},
 42            {["suggest"] = "j", ["help"] = "?"},
 43       }
 44   end
 45end
 46
 47
 48function daxie (input)
 49     if input == "c" then
 50             return {
 51            {["suggest"] = "a", ["help"] = "?"},
 52            {["suggest"] = "b", ["help"] = "?"},
 53            {["suggest"] = "c", ["help"] = "?"},
 54            {["suggest"] = "d", ["help"] = "?"},
 55            {["suggest"] = "e", ["help"] = "?"},
 56            {["suggest"] = "f", ["help"] = "?"},
 57            {["suggest"] = "g", ["help"] = "?"},
 58            {["suggest"] = "h", ["help"] = "?"},
 59            {["suggest"] = "i", ["help"] = "?"},
 60            {["suggest"] = "j", ["help"] = "?"},
 61       }
 62   end
 63end
 64
 65
 66function xiaoxie (input)
 67     if input == "d" then
 68             return {
 69            {["suggest"] = "a", ["help"] = "?"},
 70            {["suggest"] = "b", ["help"] = "?"},
 71            {["suggest"] = "c", ["help"] = "?"},
 72            {["suggest"] = "d", ["help"] = "?"},
 73            {["suggest"] = "e", ["help"] = "?"},
 74            {["suggest"] = "f", ["help"] = "?"},
 75            {["suggest"] = "g", ["help"] = "?"},
 76            {["suggest"] = "h", ["help"] = "?"},
 77            {["suggest"] = "i", ["help"] = "?"},
 78            {["suggest"] = "j", ["help"] = "?"},
 79       }
 80   end
 81end
 82
 83
 84function dian (input)
 85     if input == "e" then
 86             return {
 87            {["suggest"] = "a", ["help"] = "?"},
 88            {["suggest"] = "b", ["help"] = "?"},
 89            {["suggest"] = "c", ["help"] = "?"},
 90            {["suggest"] = "d", ["help"] = "?"},
 91            {["suggest"] = "e", ["help"] = "?"},
 92            {["suggest"] = "f", ["help"] = "?"},
 93            {["suggest"] = "g", ["help"] = "?"},
 94            {["suggest"] = "h", ["help"] = "?"},
 95            {["suggest"] = "i", ["help"] = "?"},
 96            {["suggest"] = "j", ["help"] = "?"},
 97       }
 98   end
 99end
100
101
102function xuhao (input)
103    if #input == 0 then
104        return {
105            {["suggest"] = "a", ["help"] = "??...?"},
106            {["suggest"] = "b", ["help"] = "??...?"},
107            {["suggest"] = "c", ["help"] = "??...?"},
108            {["suggest"] = "d", ["help"] = "??...?"},
109            {["suggest"] = "e", ["help"] = "??...?"},
110       }
111       
112    elseif input == "a" then
113        return quan(input)
114    elseif input == "aa" then
115        return "?"
116    elseif input == "ab" then
117        return "?"
118    elseif input == "ac" then
119        return "?"
120    elseif input == "ad"  then
121        return "?"
122    elseif input == "ae"  then
123        return "?"
124    elseif input == "af"  then
125        return "?"
126    elseif input == "ag"  then
127        return "?"
128    elseif input == "ah"  then
129        return "?"
130    elseif input == "ai"  then
131        return "?"
132    elseif input == "aj"  then
133        return "?"
134
135    elseif input == "b" then
136        return luoma(input)
137    elseif input == "ba" then
138        return "?"
139    elseif input == "bb" then
140        return "?"
141    elseif input == "bc" then
142        return "?"
143    elseif input == "bd"  then
144        return "?"
145    elseif input == "be"  then
146        return "?"
147    elseif input == "bf"  then
148        return "?"
149    elseif input == "bg"  then
150        return "?"
151    elseif input == "bh"  then
152        return "?"
153    elseif input == "bi"  then
154        return "?"
155    elseif input == "bj"  then
156        return "?"
157
158    elseif input == "c" then
159        return daxie(input)
160    elseif input == "ca" then
161        return "?"
162    elseif input == "cb" then
163        return "?"
164    elseif input == "cc" then
165        return "?"
166    elseif input == "cd"  then
167        return "?"
168    elseif input == "ce"  then
169        return "?"
170    elseif input == "cf"  then
171        return "?"
172    elseif input == "cg"  then
173        return "?"
174    elseif input == "ch"  then
175        return "?"
176    elseif input == "ci"  then
177        return "?"
178    elseif input == "cj"  then
179        return "?"
180
181    elseif input == "d" then
182        return xiaoxie(input)
183    elseif input == "da" then
184        return "?"
185    elseif input == "db" then
186        return "?"
187    elseif input == "dc" then
188        return "?"
189    elseif input == "dd"  then
190        return "?"
191    elseif input == "de"  then
192        return "?"
193    elseif input == "df"  then
194        return "?"
195    elseif input == "dg"  then
196        return "?"
197    elseif input == "dh"  then
198        return "?"
199    elseif input == "di"  then
200        return "?"
201    elseif input == "dj"  then
202        return "?"
203
204    elseif input == "e" then
205        return dian(input)
206    elseif input == "ea" then
207        return "?"
208    elseif input == "eb" then
209        return "?"
210    elseif input == "ec" then
211        return "?"
212    elseif input == "ed"  then
213        return "?"
214    elseif input == "ee"  then
215        return "?"
216    elseif input == "ef"  then
217        return "?"
218    elseif input == "eg"  then
219        return "?"
220    elseif input == "eh"  then
221        return "?"
222    elseif input == "ei"  then
223        return "?"
224    elseif input == "ej"  then
225        return "?"
226
227   end
228end
229
230------------
231
232ime.register_command("xh", "xuhao", "??????")