26 lines
832 B
Smalltalk
26 lines
832 B
Smalltalk
accessing
|
|
externalWordCloud
|
|
"TO DO: refactor with externalWordCloudWithLanguage:"
|
|
|
|
| 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-es.txt'.
|
|
"'--mask' . '../../../commons/nube-mascara.jpg'"
|
|
};
|
|
workingDirectory: self folder fullName;
|
|
redirectStdout;
|
|
redirectStderr;
|
|
runAndWaitOnExitDo: [ :process :outString | ^ outputFile asFileReference ] |