- The following documentation is located at มอดูล:zh/data/Jyutping word/documentation. [edit] Categories were auto-generated by Module:documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
--[=[
- zh/data/Jyutping word
- zh/data/Jyutping word/000
- zh/data/Jyutping word/012
- zh/data/Jyutping word/013
- zh/data/Jyutping word/014
- zh/data/Jyutping word/015
- zh/data/Jyutping word/016
- zh/data/Jyutping word/017
- zh/data/Jyutping word/018
- zh/data/Jyutping word/019
- zh/data/Jyutping word/020
- zh/data/Jyutping word/021
- zh/data/Jyutping word/022
- zh/data/Jyutping word/023
- zh/data/Jyutping word/024
- zh/data/Jyutping word/025
- zh/data/Jyutping word/026
- zh/data/Jyutping word/027
- zh/data/Jyutping word/028
- zh/data/Jyutping word/029
- zh/data/Jyutping word/030
- zh/data/Jyutping word/031
- zh/data/Jyutping word/032
- zh/data/Jyutping word/033
- zh/data/Jyutping word/034
- zh/data/Jyutping word/035
- zh/data/Jyutping word/036
- zh/data/Jyutping word/037
- zh/data/Jyutping word/038
- zh/data/Jyutping word/039
- zh/data/Jyutping word/040
- zh/data/Jyutping word/062
- zh/data/Jyutping word/063
- zh/data/Jyutping word/131
- zh/data/Jyutping word/134
- zh/data/Jyutping word/135
- zh/data/Jyutping word/142
- zh/data/Jyutping word/143
- zh/data/Jyutping word/146
- zh/data/Jyutping word/148
- zh/data/Jyutping word/150
- zh/data/Jyutping word/151
- zh/data/Jyutping word/152
- zh/data/Jyutping word/157
- zh/data/Jyutping word/158
- zh/data/Jyutping word/163
- zh/data/Jyutping word/164
- zh/data/Jyutping word/167
- zh/data/Jyutping word/169
- zh/data/Jyutping word/documentation
]=]
local export = {}
function export.get_all()
local ret = {}
for i=0,196 do --196 is the limit
success, data = pcall(mw.loadData,('Module:zh/data/Jyutping_word/%03d'):format(i))
if success then
for key,val in pairs(data) do
ret[key] = {}
val = mw.ustring.gsub(val,", ",",")
for pron in mw.text.gsplit(val,",",true) do
pron = mw.ustring.gsub(pron,",",", ")
table.insert(ret[key],pron)
end
end
end
end
return ret
end
function export.get_all_reverse()
local ret = {}
for i=0,196 do --196 is the limit
success, data = pcall(mw.loadData,('Module:zh/data/Jyutping_word/%03d'):format(i))
if success then
for key,val in pairs(data) do
val = mw.ustring.gsub(val,", ",",")
for pron in mw.text.gsplit(val,",",true) do
pron = mw.ustring.gsub(pron,",",", ")
if ret[pron] then
table.insert(ret[pron],key)
else
ret[pron] = {key}
end
end
end
end
end
return ret
end
function export.get_homophones()
local ret = export.get_all_reverse()
for key,val in pairs(ret) do
if #val == 1 then
ret[key] = nil
end
end
return ret
end
return export