2022-04-02 00:02:35 +00:00
|
|
|
accessing
|
|
|
|
externalWordCloud
|
2023-05-18 17:27:02 +00:00
|
|
|
"TO DO: refactor with externalWordCloudWithLanguage:"
|
2022-04-02 00:02:35 +00:00
|
|
|
|
|
|
|
| text outputFile |
|
2022-04-15 19:35:11 +00:00
|
|
|
self areCommonFilesInstalled
|
2022-05-14 21:56:07 +00:00
|
|
|
ifFalse: [ self installCommons ].
|
2022-04-15 01:27:26 +00:00
|
|
|
self writeWordsFile.
|
2022-04-21 17:11:53 +00:00
|
|
|
outputFile := (self folder / 'wordcloud.png') fullName.
|
2022-04-14 21:43:31 +00:00
|
|
|
text := (self folder / 'words', 'txt') fullName.
|
2022-04-02 00:02:35 +00:00
|
|
|
OSSUnixSubprocess new
|
|
|
|
command: 'wordcloud_cli';
|
|
|
|
arguments: { '--text' . text .
|
|
|
|
'--imagefile' . outputFile .
|
|
|
|
'--color' . '#5B83DE' .
|
|
|
|
'--width' . '1153' .
|
|
|
|
'--height' . '357' .
|
|
|
|
'--background' . 'white' .
|
|
|
|
'--mode' . 'RGBA' .
|
2022-04-28 04:51:53 +00:00
|
|
|
'--stopwords' . '../../../commons/stopwords-es.txt'.
|
|
|
|
"'--mask' . '../../../commons/nube-mascara.jpg'"
|
|
|
|
};
|
2022-04-02 00:02:35 +00:00
|
|
|
workingDirectory: self folder fullName;
|
|
|
|
redirectStdout;
|
|
|
|
redirectStderr;
|
|
|
|
runAndWaitOnExitDo: [ :process :outString | ^ outputFile asFileReference ]
|