Jump to content

Module:User:Oyunqi/UnitTest

ئورنى Wiktionary

Documentation for this module may be created at Module:User:Oyunqi/UnitTest/doc

soz = require('Module:سۆز ئانالىزى')
local bg = {}
function bg.boghum( frame ) 
        local txt = frame.args[1]
    if txt==nil or txt==""  then
       -- txt = mw.title.getCurrentTitle().text
       txt = mw.language.fetchLanguageName( 'ar') 
       txt = txt .. '<br/>' .. mw.language.fetchLanguageName( 'ar','en') 
       txt = txt .. '<br/>' .. mw.language.fetchLanguageName( 'ar','ug') 
       txt = txt .. '<br/>' .. mw.language.fetchLanguageName('ug') 
       txt = txt .. '<br/>' .. mw.language.fetchLanguageName( 'ug','en') 
       txt = txt .. '<br/>' .. mw.language.fetchLanguageName( 'ug','ug') 
       txt = txt .. '<br/>' .. mw.language.fetchLanguageName( 'ug','fr') 

   end
--   local s,e = mw.ustring.find( str, "(.-)[اەېىۇۈ]" ,1) 
return txt
--    return s .. "," .. e    
end

function bg.imla( frame ) 

PAGENAME = mw.title.getCurrentTitle().text
    local args = frame:getParent().args
    local str = frame.args[1]
    local bgh = args["bgh"]; if bgh == "" then bgh = nil end

   ret = ""
    if str==nil or str==""  then
       str = PAGENAME
       
   end

if mw.ustring.find(str," ")  ~= nil then
      return "سۆز بىرىكمىسى"
   end 
   if mw.ustring.find(str,"-")  ~= nil then
      return "قوشما سۆز"
   end 
ret =  str
if bgh ~= nil then 
          --return bgh
    else
       boghumlar  = soz.boghum(str)
        ret = ret .. "</br>" .. #boghumlar .. "</br>" .. table.concat(boghumlar,"'")
       if #boghumlar > 0 then
          --ret = ret .. b.fait_categorie_contenu('ئۇيغۇر تىلىدىكى ' .. san[ #boghumlar] .. ' بوغۇملۇق سۆزلەر') -- .. "</br>جەمئى بوغۇم سانى:" .. #boghumlar
       a_boghum = boghumlar[#boghumlar]
       ret = ret .. "</br>ئاخىرقى بوغۇم:" .. a_boghum
       for a_herp in mw.ustring.gmatch(str, "(.-)[اەېىوۇۆۈ]") do --for a_herp in string.gmatch(str, "%a") do
            ret = ret .. "</br>herp:".. a_herp
       end
       ret = ret .. "</br>ئەڭ ئاخىرقى تاۋۇش: " .. mw.ustring.sub(a_boghum,-1) 
       s,e = mw.ustring.find(str,"(.-)[اەېىوۇۆۈ]" , -1)
       soz = mw.ustring.sub(str,s,e)
       ret = ret .. "</br>ئاخىرقى بوغۇمدىكى ئەڭ ئاخىرقى سوزۇق تاۋۇش: " .. soz
       --ret = ret .. "</br>ئاخىرقى بوغۇمدىكى ئەڭ ئاخىرقى ئۈزۈك تاۋۇش"
       end
   end
   return   ret
end

return bg