请输入您要查询的百科知识:

 

词条 Module:User:Mr. Stradivarius/Anagramator
释义 -- This module takes text and puts the letters of all the words in random-- order. You probably shouldn't use it in articles.

local mRandom = require('Module:Random')

local lang = mw.language.getContentLanguage()

local p = {}

function p._main(text)

text = mw.ustring.gsub(text, '%f[^%s\\0]%w+%f[%s\\0]', function (s)

local isFirstCapitalized = mw.ustring.find(s, '^%u%l*$')

s = mRandom.main('list', mw.text.split(s, )) -- Make an array of characters, randomize it, and concatenate the result.

if isFirstCapitalized then

s = mw.ustring.lower(s)

s = lang:ucfirst(s)

end

return s

end)

return text

end

function p.main(frame)

local text = frame.args[1]

text = mw.text.trim(text)

return p._main(text)

end

return p

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/25 2:34:45