Moduł:Wikisłownikarz:Xoristzatziki:klucz: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Utworzenie nowej strony: „export = {} local Lf = {} local Ld = {} export.existing = {['el']=1, ['pl']=1} export['klucz'] = function (thetext,thelang) local lc = {} if export.existing[t...”
 
(Brak różnic)

Aktualna wersja na dzień 20:03, 14 wrz 2019

Dokumentacja dla tego modułu może zostać utworzona pod nazwą Moduł:Wikisłownikarz:Xoristzatziki:klucz/opis

export = {}
local Lf = {} 
local Ld = {} 

export.existing = {['el']=1, ['pl']=1}

export['klucz'] = function (thetext,thelang)
	local lc = {}
	if export.existing[thelang] == nil then
        --ISHELPFULL?: at least remove diacritics
        return nil
	end

    --lc['mdl'] = require ("Moduł:klucz/" .. thelang )   
    lc['mdl'] = require ("Moduł:Wikisłownikarz:Xoristzatziki:klucz/" .. thelang )   
	return lc['mdl']['klucz'](thetext)
end

export['odwrotne'] = function (thetext,thelang)
    local lc = {}
    lc['odwrotne'] = ''
    for c in mw.ustring.gcodepoint( thetext ) do
        lc['odwrotne'] =  mw.ustring.char(c) .. lc['odwrotne']
    end
    return export['klucz'](lc['odwrotne'], thelang )
end

--[==[:
=p['klucz']("błękitna krew", "pl")
daje: blαeαkitnakrew
=p['odwrotne']("błękitna krew", "pl")
daje: werkantikeαlαb
=p['klucz']("-Ἀθηνᾷ", "el")
daje: αθηνα
=p['klucz']("-Ἀθηνᾷ", "garbage")
daje: nil
]==]

return export