Improving external word cloud for language selection.
This commit is contained in:
parent
7b7fbceedc
commit
4c8d269712
@ -1,5 +1,6 @@
|
|||||||
accessing
|
accessing
|
||||||
externalWordCloud
|
externalWordCloud
|
||||||
|
"TO DO: refactor with externalWordCloudWithLanguage:"
|
||||||
|
|
||||||
| text outputFile |
|
| text outputFile |
|
||||||
self areCommonFilesInstalled
|
self areCommonFilesInstalled
|
||||||
|
@ -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 ]
|
Loading…
Reference in New Issue
Block a user