Module:vi/documentation

Documentation for Module:vi. [edit]
This page contains usage information, categories, interwiki links and other content describing the module.

This module provides lexicographic tools for Vietnamese language text.

Usage edit

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 _toReformedTones() on each string before sorting them using comp().