Я хочу создать облако слов. Когда моя строка на английском языке, все работает нормально:
from wordcloud import WordCloud
from matplotlib import pyplot as plt
text="""Softrock 40 - close to the 6 MHz that the P6D requires (6.062 according) - https://groups.yahoo.com/neo/groups/softrock40/conversations/messages
I want the USB model that has a controllable (not fixed) central frequency."""
wordcloud = WordCloud().generate(text)
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
Но когда я делаю то же самое на иврите, он не определяет шрифт, и я получаю только пустые прямоугольники:
text="""תחילתו של חורף מאכזב למדיי, מומחי המים בישראל מאמינים כי לראשונה השנה מפלס הכנרת יעלה בצורה משמעותית מגשמי הסערה שתחל היום"""
wordcloud = WordCloud().generate(text)
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
Любые идеи?
wordcloud = WordCloud(font_path='/font/to/some_font').generate(text)
сsome_font
шрифтом, поддерживающим символы иврита. - person Willem Van Onsem   schedule 06.01.2019/usr/share/fonts
. - person Willem Van Onsem   schedule 06.01.2019