Skip to content

Romanize(A+B) != Romanize(A) + Romanize(B) #26

@the-over-ape

Description

@the-over-ape

This script:

from pythainlp.transliterate import romanize

A = "สวัสดี ครับ"
B = "คุณ ชื่อ อะไร ครับ"
A_B = "สวัสดี ครับ คุณ ชื่อ อะไร ครับ"
print(romanize(A, engine="thai2rom"))
print(romanize(B, engine="thai2rom"))
print(romanize(A_B, engine="thai2rom"))
for z in A_B.split(' '):
    roman = romanize(z, engine="thai2rom")
    print(roman, ' ', end="")

Prints out:

sawatdi khrap
khun chue arai khrap
sawatdi khrap khun chuen chuen chuen chuen chuen chuen chuen chuen chuen chuen chuen chuen chuen chu
sawatdi  khrap  khun  chue  arai  khrap 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions