diff --git a/Socialmetrica.package/NitterUser.class/instance/externalWordCloud.st b/Socialmetrica.package/NitterUser.class/instance/externalWordCloud.st index 80f7f47..9ea846e 100644 --- a/Socialmetrica.package/NitterUser.class/instance/externalWordCloud.st +++ b/Socialmetrica.package/NitterUser.class/instance/externalWordCloud.st @@ -1,5 +1,6 @@ accessing externalWordCloud +"TO DO: refactor with externalWordCloudWithLanguage:" | text outputFile | self areCommonFilesInstalled diff --git a/Socialmetrica.package/NitterUser.class/instance/externalWordCloudWithLanguage..st b/Socialmetrica.package/NitterUser.class/instance/externalWordCloudWithLanguage..st new file mode 100644 index 0000000..fb43384 --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/externalWordCloudWithLanguage..st @@ -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 ] \ No newline at end of file