Khác biệt giữa bản sửa đổi của “Mô đun:Ruby”
imported>Admin |
|||
| (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 | -- @param tones Set to “0” to leave tone marks intact. | ||
-- @param accents | -- @param accents Set to “0” to leave accent marks intact. | ||
-- @param đ | -- @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 | ||