9 lines
390 B
Smalltalk
9 lines
390 B
Smalltalk
accessing
|
|
asMessagesUserNamesSortedByOccurrences
|
|
|
|
| response messagesOccurrences |
|
|
messagesOccurrences := (self collect: [ :tweet | tweet user userName ]) asBag contents asDictionary.
|
|
response := OrderedDictionary new.
|
|
(messagesOccurrences associations asSortedCollection: [:x :y | x value > y value])
|
|
collect: [:assoc | response at: assoc key put:assoc value].
|
|
^ response |