From 20f12bfcfc76dd4b9047aa058217d0ad5e9f42d0 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Tue, 5 Apr 2022 16:39:07 -0500 Subject: [PATCH] Draft for visualization. --- .../NitterUser.class/instance/writeWordsFile.st | 10 ++++++++++ Socialmetrica.package/Tweet.class/instance/words.st | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Socialmetrica.package/NitterUser.class/instance/writeWordsFile.st diff --git a/Socialmetrica.package/NitterUser.class/instance/writeWordsFile.st b/Socialmetrica.package/NitterUser.class/instance/writeWordsFile.st new file mode 100644 index 0000000..36a422c --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/writeWordsFile.st @@ -0,0 +1,10 @@ +accessing +writeWordsFile + | rawTweets output | + self tweets ifNil: [ ^ self ]. + rawTweets := self tweets tweets. + output := '' writeStream. + rawTweets do: [ :current | + output addAll: current words. + ]. + ^ MarkupFile exportAsFileOn: FileLocator "usersStorage" containing: output. \ No newline at end of file diff --git a/Socialmetrica.package/Tweet.class/instance/words.st b/Socialmetrica.package/Tweet.class/instance/words.st index 698a2f8..cbc1e53 100644 --- a/Socialmetrica.package/Tweet.class/instance/words.st +++ b/Socialmetrica.package/Tweet.class/instance/words.st @@ -1,3 +1,5 @@ utilities words - ^ self text allRegexMatches: '\w*' \ No newline at end of file + | rawWords | + rawWords := self textPreview splitOn: Character space. + ^ rawWords := rawWords collect: [ :word | word trimmed copyWithoutAll: #($. $, $" $“ $”) ] \ No newline at end of file