Module:User:Wikispeedier/bn-splitverb
Appearance
- The following documentation is located at Module:User:Wikispeedier/bn-splitverb/documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
All tests passed.
Name | Expected | Actual | |
---|---|---|---|
test_split |
local export = {}
function export.split(verb)
for _, ending in pairs({"েওয়া", "ওয়া", "য়া", "া", "েওয়ানো", "ওয়ানো", "য়ানো", "ানো", "োনো", "নো"}) do
local split_point = -mw.ustring.len(ending)
if mw.ustring.find(verb, ending, split_point) then
return {
stem = mw.ustring.sub(verb, 1, split_point - 1),
ending = ending
}
end
end
error('invalid verb "' .. verb .. '" (verbs must end in "া" or "নো")')
end
function export.split_tr(verb_tr)
for _, ending_tr in pairs({"eẇa", "ẇa", "a", "eẇano", "ẇano", "ano", "ono", "no"}) do
local split_point = -mw.ustring.len(ending_tr)
if mw.ustring.find(verb_tr, ending_tr, split_point) then
return {
stem_tr = mw.ustring.sub(verb_tr, 1, split_point - 1),
ending_tr = ending_tr
}
end
end
error('invalid verb "' .. verb_tr .. '" (verbs must end in "a" or "no")')
end
return export