| | |
| Line 23: | Line 23: |
| | | | |
| | <includeonly> | | <includeonly> |
| | + | [[Category:Vietnamese templates]] |
| | [[Category:Utility modules]] | | [[Category:Utility modules]] |
| | | | |
This module provides lexicographic tools for Vietnamese language text.
In a template:
{{#invoke:vi|toReformedTones|xóa}} → xoá {{#invoke:vi|toTraditionalTones|xoá}} → xóa {{#invoke:vi|removeDiacritics|thay đổi gần đây}} → thay doi gan day {{#invoke:vi|removeDiacritics|thay đổi gần đây|tones=0}} → thay dỏi gàn day {{#invoke:vi|removeDiacritics|thay đổi gần đây|accents=0}} → thay dôi gân dây {{#invoke:vi|removeDiacritics|thay đổi gần đây|đ=0}} → thay đoi gan đay
In another module:
viet = require "Module:vi" t = {"an ninh", "bóng rổ", "Ả Rập", "bóng đá", "ăn", "Á Châu"} table.sort(t, viet.comp) causes t to hold: Ả Rập, Á Châu, an ninh, ăn, bóng đá, bóng rổ
For best results, call _toTraditionalTones() or _toModernTones() on each string before sorting them using comp().