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