Модул:Корисник:Steborce/Templates/MyString
Документацијата за овој модул можете да ја создадете на Модул:Корисник:Steborce/Templates/MyString/док
local export = {} --p stands for package
stem=""
stem_1=""
stem_2=""
tipv=""
tipv_1=""
tipv_2=""
tipv_3=""
tipmorf=""
debug=""
function export.SumKonstr (frame)
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1="" ed1f="" ed2f=""
local base=""
local rtyval=""
nasl="'''Сум конструкција'''"
export.Basic(frame)
if tipv=="а" then
base=stem.."а"
else
base=stem.."е"
end
ed1="сум "..base.."н"
ed1f="сум "..base.."на"
ed2="си "..base.."н"
ed2f="си "..base.."на"
ed3m="е "..base.."н"
ed3f="е "..base.."на"
ed3n="е "..base.."но"
mn1="сме "..base.."ни"
mn2="сте "..base.."ни"
mn3="се "..base.."ни"
rtyval="|-\n | rowspan=\"3\" | "..nasl.."|| м.р. || "..ed1.." || "..ed2.."|| "..ed3m.." || rowspan=\"3\" |"..mn1.." || rowspan=\"3\" | "..mn2.." || rowspan=\"3\" | "..mn3
rty1r="\n|-\n| ж.р. || "..ed1f.." || "..ed2f.." || "..ed3f
rty2r="\n|-\n| с.р. || colspan=\"2\"| ||"..ed3n
return rtyval..rty1r..rty2r
end
function export.ImaKonstr (frame)
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3=""
local base=""
local rtyval=""
nasl="'''Има конструкција'''"
export.Basic(frame)
if tipv=="а" then
base=stem.."а"
else
base=stem.."е"
end
ed1="имам "..base.."но"
ed2="имаш "..base.."но"
ed3="има "..base.."но"
mn1="имаме "..base.."но"
mn2="имате "..base.."но"
mn3="имаат "..base.."но"
rtyval="|-\n | colspan=\"2\" |"..nasl.."|| "..ed1.." || "..ed2.." || "..ed3.." || "..mn1.." || "..mn2.." || "..mn3
return rtyval
end
function export.GlagolPrilog (frame)
local args = frame:getParent().args
local svr= args[2]
local ed1=""
local base=""
local rtyval=""
if not (svr==nil) then
svr= mw.text.trim(svr)
else
svr=""
end
nasl="'''Глаголски прилог'''"
export.Basic(frame)
if svr=="несвршен" then
if tipv=="а" then
base=stem.."а"
else
base=stem.."е"
end
ed1=base.."јќи"
rtyval="|-\n |colspan=\"2\"|"..nasl.."|| style=\"text-align: center\" colspan=\"6\"|"..ed1
end
return rtyval
end
function export.GlagolImenka (frame)
local args = frame:getParent().args
local svr= args[2]
local ed1="" mn1=""
local base=""
local rtyval=""
if not (svr==nil) then
svr= mw.text.trim(svr)
else
svr=""
end
nasl="'''Глаголска именка'''"
export.Basic(frame)
if svr=="несвршен" then
if tipv=="а" then
base=stem.."а"
else
base=stem.."е"
end
ed1=base.."ње"
mn1=base.."ња"
rtyval="|-\n |colspan=\"2\"|"..nasl.."|| style=\"text-align: center\" colspan=\"3\"|"..ed1.." || style=\"text-align: center\" colspan=\"3\" | "..mn1
end
return rtyval
end
function export.MinatoOpSvr( frame )
local args = frame:getParent().args
local svr= args[2]
local jrule="" krule=""
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3=""
local rtyval=""
local osnova=""
local osn={}
if not (svr==nil) then
svr= mw.text.trim(svr)
else
svr=""
end
if svr=="свршен" then
osn=export.lFormaStem (frame)
osnova=osn[1]
-- Prvo Lice ednina
ed1=osnova.."в"
-- Vtoro i Treto Lice ednina
if tipmorf=="ео" then
ed2=stem.."е"
debug="1"
elseif tipmorf=="еа" or tipmorf=="иа" then
if tipv_1=="р" then
debug="2"
ed2=stem_1.."а"
else
debug="3"
ed2=osnova
end
else
debug="4"
ed2=osnova
end
-- Prvo Lice mnozina
mn1=osnova.."вме"
-- Vtoro Lice mnozina
mn2=osnova.."вте"
-- Treto Lice mnozina
if tipmorf=="ии" then
mn3=osnova..jrule.."ја"
else
mn3=osnova..jrule.."а"
end
rtyval="|-\n | colspan=\"2\"|''' Минато определено <br> свршено време'''"..debug.."||"..ed1.."||"..ed2.."|| "..ed2.." ||"..mn1.."|| "..mn2.."||"..mn3
end
return rtyval
end
function export.MozenNacin (frame)
local args = frame:getParent().args
local svr= args[2]
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1="" ed1f="" ed2f=""
local segarr={}
local base="" base1=""
local rtyval=""
local debug=""
local osn={}
if not (svr==nil) then
svr= mw.text.trim(svr)
else
svr=""
end
nasl="'''Можен начин'''"
osn=export.lFormaStem ( frame )
base=osn[2]
base1=osn[3]
ed1="би "..base.."л"
ed1f="би "..base.."ла"
ed2="би "..base.."л"
ed2f="би "..base.."ла"
ed3m="би "..base.."л"
ed3f="би "..base1.."ла"
ed3n="би "..base1.."ло"
mn1="би "..base1.."ле"
mn2="би "..base1.."ле"
mn3="би "..base1.."ле"
rtyval="|-\n | rowspan=\"3\" | "..nasl.."|| м.р. || "..ed1.." || "..ed2.."|| "..ed3m.." || rowspan=\"3\" |"..mn1.." || rowspan=\"3\" | "..mn2.." || rowspan=\"3\" | "..mn3
rty1r="\n|-\n| ж.р. || "..ed1f.." || "..ed2f.." || "..ed3f
rty2r="\n|-\n| с.р. || colspan=\"2\"| ||"..ed3n
return rtyval..rty1r..rty2r
end
function export.IdnoPrekazano (frame)
local args = frame:getParent().args
local svr= args[2]
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1="" ed1f="" ed2f=""
local segarr={}
local base="" base1=""
local rtyval=""
local debug=""
local osn={}
if not (svr==nil) then
svr= mw.text.trim(svr)
else
svr=""
end
nasl="'''Идно прекажано време'''"
osn=export.lFormaStem ( frame )
base=osn[2]
base1=osn[3]
ed1="ќе сум "..base.."л"
ed1f="ќе сум "..base.."ла"
ed2="ќе си "..base.."л"
ed2f="ќе си "..base.."ла"
ed3m="ќе "..base.."л"
ed3f="ќе "..base1.."ла"
ed3n="ќе "..base1.."ло"
mn1="ќе сме "..base1.."ле"
mn2="ќе сте "..base1.."ле"
mn3="ќе "..base1.."ле"
rtyval="|-\n | rowspan=\"3\" | "..nasl.."|| м.р. || "..ed1.." || "..ed2.."|| "..ed3m.." || rowspan=\"3\" |"..mn1.." || rowspan=\"3\" | "..mn2.." || rowspan=\"3\" | "..mn3
rty1r="\n|-\n| ж.р. || "..ed1f.." || "..ed2f.." || "..ed3f
rty2r="\n|-\n| с.р. || colspan=\"2\"| ||"..ed3n
return rtyval..rty1r..rty2r
end
function export.PredMinato (frame)
local args = frame:getParent().args
local svr= args[2]
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1="" ed1f="" ed2f=""
local segarr={}
local base="" base1=""
local rtyval=""
local debug=""
local osn={}
if not (svr==nil) then
svr= mw.text.trim(svr)
else
svr=""
end
nasl="'''Предминато време'''"
osn=export.lFormaStem ( frame )
base=osn[2]
base1=osn[3]
ed1="бев "..base.."л"
ed1f="бев "..base.."ла"
ed2="беше "..base.."л"
ed2f="беше "..base.."ла"
ed3m="беше "..base.."л"
ed3f="беше "..base1.."ла"
ed3n="беше "..base1.."ло"
mn1="бевме "..base1.."ле"
mn2="бевте "..base1.."ле"
mn3="беа "..base1.."ле"
rtyval="|-\n | rowspan=\"3\" | "..nasl.."|| м.р. || "..ed1.." || "..ed2.."|| "..ed3m.." || rowspan=\"3\" |"..mn1.." || rowspan=\"3\" | "..mn2.." || rowspan=\"3\" | "..mn3
rty1r="\n|-\n| ж.р. || "..ed1f.." || "..ed2f.." || "..ed3f
rty2r="\n|-\n| с.р. || colspan=\"2\"| ||"..ed3n
return rtyval..rty1r..rty2r
end
function export.MinatoNeopVr (frame)
local args = frame:getParent().args
local svr= args[2]
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1="" ed1f="" ed2f=""
local segarr={}
local base="" base1=""
local rtyval=""
local debug=""
local osn={}
if not (svr==nil) then
svr= mw.text.trim(svr)
else
svr=""
end
nasl="'''Минато неопределено <br> "..svr.."o време'''"
osn=export.lFormaStem ( frame )
base=osn[2]
base1=osn[3]
ed1="сум "..base.."л"
ed1f="сум "..base.."лa"
ed2="си "..base.."л"
ed2f="си "..base.."лa"
ed3m=base.."л"
ed3f=base1.."ла"
ed3n=base1.."ло"
mn1="сме "..base1.."ле"
mn2="сте "..base1.."ле"
mn3=base1.."ле"
rtyval="|-\n | rowspan=\"3\" | "..nasl.."|| м.р. || "..ed1.." || "..ed2.."|| "..ed3m.." || rowspan=\"3\" |"..mn1.." || rowspan=\"3\" | "..mn2.." || rowspan=\"3\" | "..mn3
rty1r="\n|-\n| ж.р. || "..ed1f.." || "..ed2f.." || "..ed3f
rty2r="\n|-\n| с.р. || colspan=\"2\"| ||"..ed3n
return rtyval..rty1r..rty2r
end
function export.GlagolPridavka (frame)
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1=""
local segarr={}
local base="" base1=""
local rtyval=""
local debug=""
local osn={}
nasl="'''Глаголска придавка'''"
osn=export.lFormaStem ( frame )
if tipv=="а" then
base=stem.."а"
else
base=stem.."е"
end
ed1=base.."н"
ed2=base.."на"
ed3=base.."но"
mn1=base.."ни"
rtyval="|-\n | rowspan=\"3\" | '''Глаголска придавка'''|| м.р. || style=\"text-align: center\" colspan=\"3\"|"..ed1.." || style=\"text-align: center\" colspan=\"3\" rowspan=\"3\" | "..mn1
rty1r="\n|-\n| ж.р. || style=\"text-align: center\" colspan=\"3\"|"..ed2
rty2r="\n|-\n| с.р. || style=\"text-align: center\" colspan=\"3\"|"..ed3
return rtyval..rty1r..rty2r
end
function export.lForma (frame)
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1=""
local segarr={}
local base="" base1=""
local rtyval=""
local debug=""
local osn={}
osn=export.lFormaStem ( frame )
base=osn[2]
base1=osn[3]
ed1=base.."л"
ed2=base1.."ла"
ed3=base1.."ло"
mn1=base1.."ле"
rtyval="|-\n | rowspan=\"3\" | '''Глаголска л-форма'''|| м.р. || style=\"text-align: center\" colspan=\"3\"|"..ed1.." || style=\"text-align: center\" colspan=\"3\" rowspan=\"3\" | "..mn1
rty1r="\n|-\n| ж.р. || style=\"text-align: center\" colspan=\"3\"|"..ed2
rty2r="\n|-\n| с.р. || style=\"text-align: center\" colspan=\"3\"|"..ed3
return rtyval..rty1r..rty2r
end
function export.GlagolskaPridavka (frame)
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1=""
local segarr={}
local base="" base1=""
local rtyval=""
local debug=""
local osn={}
nasl="'''Глаголска придавка'''"
osn=export.lFormaStem ( frame )
if tipv=="а" then
base=stem.."а"
else
base=stem.."е"
end
ed1=base.."н"
ed2=base.."на"
ed3=base.."но"
mn1=base.."ни"
rtyval="|-\n | rowspan=\"3\" | '''Глаголска придавка'''|| м.р. || style=\"text-align: center\" rowspan=\"3\" colspan=\"2\"|"..ed1.." || style=\"text-align: center\" colspan=\"1\"|"..ed1.." || style=\"text-align: center\" colspan=\"3\" rowspan=\"3\" | "..mn1
rty1r="\n|-\n| ж.р. || style=\"text-align: center\" colspan=\"1\"|"..ed2
rty2r="\n|-\n| с.р. || style=\"text-align: center\" colspan=\"1\"|"..ed3
return rtyval..rty1r..rty2r
end
function export.MinatoIdno( frame )
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1=""
local osnova=""
local rtyval=""
export.Basic(frame)
if tipv=="а" then
osnova=stem.."а"
else
osnova=stem.."е"
end
ed1="ќе "..osnova.."в"
ed2="ќе "..osnova.."ше"
ed3="ќе "..osnova.."ше"
mn1="ќе "..osnova.."вме"
mn2="ќе "..osnova.."вте"
mn3="ќе "..osnova.."а"
rtyval="|-\n | colspan=\"2\" | '''Минато идно време'''|| "..ed1.." || "..ed2.." || "..ed3.." || "..mn1.." || "..mn2.." || "..mn3
return rtyval
end
function export.Zapoveden( frame )
local args = frame:getParent().args
local svr= args[2]
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1=""
local segarr={}
local rtyval=""
local tip=1
if not (svr==nil) then
svr= mw.text.trim(svr)
else
svr=""
end
segarr=export.Basic(frame)
ed1=""
ed3=""
mn1=""
mn3=""
if tipv_1=="а" or tipv_1=="е" or tipv_1=="и" or tipv_1=="о" or tipv_1=="у" then
tip=2
end
if tipv=="а" then
ed2=stem.."ај"
mn2=stem.."ајте"
elseif tipv=="е" then
if tip==1 then
if tipv_3=="д" and tipv_2=="а" and tipv_1=="д" then
ed2=stem_1.."ј"
mn2=stem_1.."јте"
else
ed2=stem.."и"
mn2=stem.."ете"
end
else
ed2=stem.."j"
mn2=stem.."jте"
end
elseif tipv=="и" then
if tip==1 then
ed2=stem.."и"
mn2=stem.."ете"
else
ed2=stem.."j"
mn2=stem.."jте"
end
else
ed2="???!??"
mn2="???!??"
end
rtyval="|-\n | colspan=\"2\" |'''Заповеден начин'''|| "..ed1.." || "..ed2.." || "..ed3.." || "..mn1.." || "..mn2.." || "..mn3
return rtyval
end
function export.lFormaStem ( frame )
local args = frame:getParent().args
local str= args[1]
local svr= args[2]
local razdel= args[3]
local jrule="" krule=""
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3=""
local rtyval=""
local osnova="" losnovam="" losnovaf=""
local rosnova={}
if not (svr==nil) then
svr= mw.text.trim(svr)
end
if not (razdel==nil) then
razdel= mw.text.trim(razdel)
else
razdel=""
end
if str==nil then
str=""
else
str=mw.text.trim(str)
end
export.Basic(frame)
if tipv=="а" then
tipmorf="a"
elseif tipv=="и" then
tipmorf="и"..razdel
else
tipmorf="е"..razdel
end
if svr=="свршен" then
-- Правило за пишување на буквата ј помеѓу две согласки
-- Ако пред а, се наоѓа и,о или у помеѓу нив се пишува ј: пи-ј-ам бро-ј-ам зу-ј-ат
-- Помеѓу две а во минато определено свршено време ти истраја
-- Во група од три или повеќе самогласки во непосреден допир во 3 л. мн. на минатото определено време: знаеја, миеја
-- Во формите за еднина и множина на заповедниот начин кај глаголите чија основа завршува на -и: биј – бијте, вриј – вријте, криј – кријте, спиј – спијте.
if tipv_1=="а" or tipv_1=="е" or tipv_1=="и" or tipv_1=="о" or tipv_1=="у" then
jrule="j"
end
-- Правило за замена на ч со к и ж со г кај свршените глаголи
-- Ако после самогласка на крајот од зборот имаме ч кај глаголите од групата е раздел а или о тогаш ч преминува во к рече->>реков
-- Ако после самогласка на крајот од зборот имаме ч кај глаголите од групата и раздел а ч преминува во к грачи->>гракав
-- Ако после самогласка на крајот од зборот имаме ж кај глаголите од групата е раздел а или о тогаш ж преминува во г струже->>стругав стриже->>стригов
-- Кај молзе и влезе з преминува во г влезе->>влегов молзе->>молгов
if tipv_2=="а" or tipv_2=="е" or tipv_2=="и" or tipv_2=="о" or tipv_2=="у" then
if tipv_1=="ч" then
krule="к"
elseif tipv_1=="ж" or str=="влезе" or str=="молзе" then
krule="г"
else
krule=tipv_1
end
else
krule=tipv_1
end
-- Правило за исфрлање на буквата р кај е групата на свршени глаголи раздел а бере->> брав
if tipv_1=="р" and tipv_2=="е" and tipmorf=="еа" then
stem_1=stem_2..tipv_1
tipv=""
krule=""
end
if tipmorf=="a" or tipmorf=="еа" or tipmorf=="иа" then
osnova=stem_1..krule..jrule.."а"
losnovam=osnova
losnovaf=osnova
elseif tipmorf=="ео" then
osnova=stem_1..krule.."о"
losnovam=osnova
losnovaf=osnova
if tipv_1=="д" then
if tipv_2=="ј" then
losnovam=stem_2.."шо"
losnovaf=stem_2.."ш"
elseif tipv_2=="и" then
losnovam=stem_1.."шо"
losnovaf=stem_1.."ш"
else
losnovam=stem_1
losnovaf=stem_1
end
end
elseif tipmorf=="ии" then
osnova=stem.."и"
losnovam=osnova
losnovaf=osnova
elseif tipmorf=="е" then
osnova=stem_1.."и"
losnovam=osnova
losnovaf=osnova
else
osnova=stem.."е"
losnovam=osnova
losnovaf=osnova
end
elseif svr=="несвршен" then
if tipv=="а" then
osnova=stem.."а"
else
osnova=stem.."е"
end
losnovam=osnova
losnovaf=osnova
end
rosnova={osnova,losnovam,losnovaf}
return rosnova
end
function export.MinatoOpNesvr( frame )
local args = frame:getParent().args
local svr= args[2]
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3=""
local rtyval=""
local jrule=""
local osn={}
local osnova=""
if not (svr==nil) then
svr= mw.text.trim(svr)
end
--export.Basic(frame)
osn=export.lFormaStem(frame)
osnova=osn[1]
if tipv_1=="а" or tipv_1=="е" or tipv_1=="и" or tipv_1=="о" or tipv_1=="у" then
jrule="j"
end
if svr=="несвршен" then
-- Prvo Lice ednina
ed1=osnova.."в"
-- Vtoro Lice ednina
ed2=osnova.."ше"
-- Treto Lice ednina
ed3=osnova.."ше"
-- Prvo Lice mnozina
mn1=osnova.."вме"
-- Vtoro Lice mnozina
mn2=osnova.."вте"
-- Treto Lice mnozina
if tipv=="а" then
mn3=osnova.."а"
else
mn3=osnova..jrule.."а"
end
rtyval="|-\n | colspan=\"2\" | ''' Минато определено <br> несвршено време'''||"..ed1.."||"..ed2.."|| "..ed3.." ||"..mn1.."|| "..mn2.."||"..mn3
end
return rtyval
end
function export.IdnoVreme( frame )
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1=""
local segarr={}
local rtyval=""
segarr=export.SegasnoStem ( frame )
ed1="ќе "..segarr[1]
ed2="ќе "..segarr[2]
ed3="ќе "..segarr[3]
mn1="ќе "..segarr[4]
mn2="ќе "..segarr[5]
mn3="ќе "..segarr[6]
rtyval="|-\n | colspan=\"2\" | '''Идно време'''|| "..ed1.." || "..ed2.." || "..ed3.." || "..mn1.." || "..mn2.." || "..mn3
return rtyval
end
function export.SegasnoVreme( frame )
local ed1="" ed2="" ed3="" mn1="" mn2="" mn3="" ed1=""
local segarr={}
local rtyval=""
segarr=export.SegasnoStem ( frame )
ed1=segarr[1]
ed2=segarr[2]
ed3=segarr[3]
mn1=segarr[4]
mn2=segarr[5]
mn3=segarr[6]
rtyval="|-\n | colspan=\"2\" |'''Сегашно време'''|| "..ed1.." || "..ed2.." || "..ed3.." || "..mn1.." || "..mn2.." || "..mn3
return rtyval
end
function export.SegasnoStem ( frame )
local args = frame:getParent().args
local str = args[1]
local ed1="" sed2="" ed3="" mn1="" mn2="" mn3="" ed1=""
local jrule=""
local stemarr={}
export.Basic(frame)
if str==nil then
str=""
else
str=mw.text.trim(str)
end
debug=str
if tipv_1=="и" or tipv_1=="о" or tipv_1=="у" then
jrule="j"
end
-- Prvo Lice ednina
if str=="знае" then
ed1="знам"
else
ed1=stem..jrule.."ам"
end
-- Vtoro Lice ednina
ed2=stem..tipv.."ш"
-- Treto Lice ednina
ed3=stem..tipv
-- Prvo Lice mnozina
mn1=stem..tipv.."ме"
-- Vtoro Lice mnozina
mn2=stem..tipv.."те"
-- Treto Lice mnozina
if tipv=="а" then
mn3=stem.."аат"
else
mn3=stem..jrule.."ат"
end
stemarr={ed1,ed2,ed3,mn1,mn2,mn3}
return stemarr
end
function export.Basic( frame )
local args = frame:getParent().args
local str = args[1]
local svr = args[2]
local dvesoglaski="no"
local t = {}
local i = 0
local j=0
if not (svr==nil) then
svr= mw.text.trim(svr)
end
if not (str==nil) then
str= mw.text.trim(str)
else
str=""
end
do
while true do
i = i + 1
t[i]= mw.ustring.codepoint( str, i, i+1 )
if t[i]==nil then
break
end
end
end
do
while j<i-2 do
j = j + 1
stem=stem..mw.ustring.char(t[j])
if j<i-2 then
stem_1=stem_1..mw.ustring.char(t[j])
end
if j<i-3 then
stem_2=stem_2..mw.ustring.char(t[j])
end
end
end
if i>1 then
tipv=mw.ustring.char(t[i-1])
if i>2 then
tipv_1=mw.ustring.char(t[i-2])
if i>3 then
tipv_2=mw.ustring.char(t[i-3])
if i>4 then
tipv_3=mw.ustring.char(t[i-4])
end
end
end
end
end
return export