Jump to content

Template:Th-rm/doc

From The Petit Planet Wiki
This is the documentation page for Th-rm.
It contains usage information, categories, and other content not part of the original template page.
This template uses Module:Th-rm, a script written in Lua.

Template to automate the romanization of Thai text based on the Petit Planet Wiki:Thai guidelines.

Syntax

[edit source]

{{th-rm|Thai text|capi = include to capitalize each word|sent = include to use sentence case}}

  • The romanization follows the Petit Planet Wiki:Thai guidelines, which are based on the Royal Thai General System of Transcription (RTGS).
  • The template is primarily intended as an automatic fallback for the Other languages template. Editors should provide a manual romanization when a name has an irregular or otherwise ambiguous pronunciation.
Capitalization
  • capi can be used to capitalize each word in the romanization. For example:
    • {{th-rm|สถาบันไทยคดีศึกษา|capi = 1}} yields: SathabanaityokdisueksaⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
  • sent can be used to capitalize the first word and words following sentence-ending punctuation. For example:
    • {{th-rm|สวัสดีครับ. วันนี้เป็นอย่างไรบ้าง|sent = 1}} yields: Swatdikrap. wannipenoi-ngainba-ngaⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
Hyphenation and spacing corrections
  • < > can be added to insert a space into the romanization.
  • <-> can be added to insert a hyphen into the romanization.
  • These corrections should only be used when the automatic romanization cannot determine the desired separation.
  • For example:
    • {{th-rm|สง่า<->งาม}} yields: song-ngamⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.

Examples

[edit source]
Default

{{th-rm|สง่างาม}} yields: songngamⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|ทราย}} yields: saiⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|จริง}} yields: chingⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|ศรี}} yields: siⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|บุตร}} yields: butraⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|เพชร}} yields: phetraⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|ลักษณ์}} yields: laksonⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.

Words with spaces

{{th-rm|สถาบันไทยคดีศึกษา}} yields: sathabanaityokdisueksaⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|โชคชัย จิตงาม}} yields: chokchai chitngamⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.

Forced capitalization

{{th-rm|สถาบันไทยคดีศึกษา|capi = 1}} yields: SathabanaityokdisueksaⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.

Sentence case

{{th-rm|สวัสดีครับ. วันนี้เป็นอย่างไรบ้าง|sent = 1}} yields: Swatdikrap. wannipenoi-ngainba-ngaⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.

Consonant exceptions

{{th-rm|ทราย}} yields: saiⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|ทราบ}} yields: sapⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|ทรง}} yields: songⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|หนา}} yields: naⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|หนี}} yields: niⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|จริง}} yields: chingⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.
{{th-rm|ศรี}} yields: siⓘThis romanization was generated automatically. Please add a user-curated romanization as soon as possible.

  • Thai words normally do not use spaces to separate words. Automatic romanization therefore cannot always determine word boundaries from Thai orthography alone.
  • When a manual romanization is supplied to a template using this module as a fallback, the manual romanization should take precedence.
  • This module follows the romanization rules described at Petit Planet Wiki:Thai rather than attempting to provide a phonetic transcription of Thai.

Template Data

[edit source]

Template to automate the romanization of Thai text.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Text1

Thai text to be romanized.

Example
สง่างาม
Stringrequired
Title Casecapi

Transform the romanization into title case.

Booleansuggested
Sentence Casesent

Transform the romanization into sentence case.

Booleansuggested