Improving external word cloud for language selection.

This commit is contained in:
ruidajo 2023-05-18 12:27:02 -05:00
parent 7b7fbceedc
commit 4c8d269712
2 changed files with 27 additions and 0 deletions

View File

@ -1,5 +1,6 @@
accessing
externalWordCloud
"TO DO: refactor with externalWordCloudWithLanguage:"
| text outputFile |
self areCommonFilesInstalled

View File

@ -0,0 +1,26 @@
accessing
externalWordCloudWithLanguage: language
"I proces and render a wordcloud image without stopwords in: es and en."
| text outputFile |
self areCommonFilesInstalled
ifFalse: [ self installCommons ].
self writeWordsFile.
outputFile := (self folder / 'wordcloud.png') fullName.
text := (self folder / 'words', 'txt') fullName.
OSSUnixSubprocess new
command: 'wordcloud_cli';
arguments: { '--text' . text .
'--imagefile' . outputFile .
'--color' . '#5B83DE' .
'--width' . '1153' .
'--height' . '357' .
'--background' . 'white' .
'--mode' . 'RGBA' .
'--stopwords' . '../../../commons/stopwords-', language, '.txt'.
"'--mask' . '../../../commons/nube-mascara.jpg'"
};
workingDirectory: self folder fullName;
redirectStdout;
redirectStderr;
runAndWaitOnExitDo: [ :process :outString | ^ outputFile asFileReference ]