Socialmetrica/Socialmetrica.package/NitterUser.class/instance/writeWordsFile.st

16 lines
546 B
Smalltalk

accessing
writeWordsFile
| rawTweets rawWords collectionsWords count |
self tweets ifNil: [ ^ self ].
rawTweets := self tweets tweets.
rawWords := OrderedCollection new.
collectionsWords := ((rawTweets select:
[ :tweet | tweet user userName = self userName ])
collect: [ :tweet | (tweet words
reject: [ :w | w includesSubstring: 'nitter42lfr' ]) ]).
collectionsWords do: [ :word | rawWords addAll: word ].
rawWords := ' ' join:rawWords.
^ MarkupFile exportAsFileOn: (self folder / 'words', 'txt') containing: rawWords.