Skip to content

It does not display the tonal in Thai. #272

@wannaphong

Description

@wannaphong
import matplotlib.pyplot as plt
from wordcloud import WordCloud
text = "แมว กิน ปลา แมว มัน ชอบ นอน นอน กลางวัน นอน แล้ว นอน อีก เป็น สัตว์ ที่ ขี้เกียจ จริงๆ เลย แมว แต่ แมว มัน เข้ากับ คน ได้ดี ฉัน ชอบ แมว"
wordcloud = WordCloud(font_path='THSarabunNew.otf',
                      relative_scaling = 1.0,
                      min_font_size=4,
                      background_color="white",
                      width=1024,
                      height=768,
                      scale=3,
                      font_step=1,
                      collocations=False,
                      margin=2
                      ).generate(text)
plt.imshow(wordcloud, cmap=plt.cm.gray, interpolation='bilinear')
plt.axis("off")
plt.show()

It does not display the tonal in Thai. Both of which I use Thai font.

Thank You.

figure_1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions