Khác biệt giữa bản sửa đổi của “Mô đun:Ruby”

imported>Admin
Đã lùi lại sửa đổi 4253 của Admin (thảo luận)
 
Đã lùi lại sửa đổi 17974 của Admin (thảo luận)
 
(không hiển thị 4 phiên bản ở giữa của cùng người dùng)
Dòng 64: Dòng 64:
---Unicode codepoints for combining Vietnamese tone marks.
---Unicode codepoints for combining Vietnamese tone marks.
p.combiningToneMarks = mw.ustring.char(
p.combiningToneMarks = mw.ustring.char(
0x300, -- à
0x300, -- à
0x301, -- á
0x301, -- á
0x303, -- ã
0x303, -- ã
0x309, -- ả
0x309, -- ả
0x323   -- ạ
0x323 -- ạ
)
)


---Unicode codepoints for combining Vietnamese accent marks.
---Unicode codepoints for combining Vietnamese accent marks.
p.combiningAccentMarks = mw.ustring.char(
p.combiningAccentMarks = mw.ustring.char(
0x302, -- â
0x302, -- â
0x306, -- ă
0x306, -- ă
0x31b   -- ơ
0x31b -- ơ
)
)


---Strips Vietnamese diacritical marks from the given text.
---Strips Vietnamese diacritical marks from the given text.
-- @param tones     Set to “0” to leave tone marks intact.
-- @param tones   Set to “0” to leave tone marks intact.
-- @param accents   Set to “0” to leave accent marks intact.
-- @param accents Set to “0” to leave accent marks intact.
-- @param đ         Set to “0” to leave “Đ” and “đ” intact.
-- @param đ     Set to “0” to leave “Đ” and “đ” intact.
function p.removeDiacritics(text, toneMarks, accentMarks, stroke)
function p.removeDiacritics(text, toneMarks, accentMarks, stroke)
if type(text) == "table" then
if type(text) == "table" then