Making word cloud reproducible in local copy.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-14 20:27:26 -05:00
parent 216832c3e2
commit d61490e96c
3 changed files with 8 additions and 5 deletions

View File

@ -2,6 +2,7 @@ accessing
externalWordCloud
| text outputFile |
self writeWordsFile.
outputFile := (self folder / 'nube.png') fullName.
text := (self folder / 'words', 'txt') fullName.
OSSUnixSubprocess new
@ -13,8 +14,8 @@ externalWordCloud
'--height' . '357' .
'--background' . 'white' .
'--mode' . 'RGBA' .
'--stopwords' . '../commons/stopwords-es.txt' .
'--mask' . '../commons/nube-mascara.jpg'};
'--stopwords' . '../../../commons/stopwords-es.txt' .
'--mask' . '../../../commons/nube-mascara.jpg'};
workingDirectory: self folder fullName;
redirectStdout;
redirectStderr;

View File

@ -1,6 +1,6 @@
accessing
writeWordsFile
"TO DO: Debug Tweet words to work better with Urls"
| rawTweets rawWords collectionsWords count |
self messages ifNil: [ ^ self ].
rawTweets := self tweets messages.
@ -9,7 +9,9 @@ writeWordsFile
collectionsWords := ((rawTweets select:
[ :tweet | tweet authorId = self id ])
collect: [ :tweet | (tweet words
reject: [ :w | w includesSubstring: self class nitterProvider ]) ]).
reject: [ :w |
w includesSubstring:
((self class nitterProvider asUrl host copyWithoutAll: '.'))]) ]).
collectionsWords do: [ :word | rawWords addAll: word ].
rawWords := ' ' join:rawWords.