diff --git a/packages/SqueakInboxTalkExtras-Semantics.package/Dictionary.extension/instance/talkSemanticWithValuesSorted..st b/packages/SqueakInboxTalkExtras-Semantics.package/Dictionary.extension/instance/talkSemanticWithValuesSorted..st new file mode 100644 index 0000000..1c89f7f --- /dev/null +++ b/packages/SqueakInboxTalkExtras-Semantics.package/Dictionary.extension/instance/talkSemanticWithValuesSorted..st @@ -0,0 +1,12 @@ +*SqueakInboxTalkExtras-Semantics-Core-sorting +talkSemanticWithValuesSorted: aSortBlockOrNil + + | sorted | + sorted := OrderedDictionary new: self size. + (self associations sorted: + (aSortBlockOrNil + ifNil: [[:someAssoc :otherAssoc | someAssoc value <= otherAssoc value]] + ifNotNil: [[:someAssoc :otherAssoc | aSortBlockOrNil value: someAssoc value value: otherAssoc value]])) + do: [:assoc | + sorted add: assoc]. + ^ sorted \ No newline at end of file diff --git a/packages/SqueakInboxTalkExtras-Semantics.package/Dictionary.extension/methodProperties.json b/packages/SqueakInboxTalkExtras-Semantics.package/Dictionary.extension/methodProperties.json new file mode 100644 index 0000000..996cd90 --- /dev/null +++ b/packages/SqueakInboxTalkExtras-Semantics.package/Dictionary.extension/methodProperties.json @@ -0,0 +1,5 @@ +{ + "class" : { + }, + "instance" : { + "talkSemanticWithValuesSorted:" : "ct 6/20/2024 01:06" } } diff --git a/packages/SqueakInboxTalkExtras-Semantics.package/Dictionary.extension/properties.json b/packages/SqueakInboxTalkExtras-Semantics.package/Dictionary.extension/properties.json new file mode 100644 index 0000000..cb1bf50 --- /dev/null +++ b/packages/SqueakInboxTalkExtras-Semantics.package/Dictionary.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "Dictionary" } diff --git a/packages/SqueakInboxTalkExtras-Semantics.package/TalkSemanticAgent.class/instance/searchExact.semantic..st b/packages/SqueakInboxTalkExtras-Semantics.package/TalkSemanticAgent.class/instance/searchExact.semantic..st index 5d2e64c..f3487da 100644 --- a/packages/SqueakInboxTalkExtras-Semantics.package/TalkSemanticAgent.class/instance/searchExact.semantic..st +++ b/packages/SqueakInboxTalkExtras-Semantics.package/TalkSemanticAgent.class/instance/searchExact.semantic..st @@ -38,7 +38,7 @@ searchExact: exactTerms semantic: semanticTerms sum := Dictionary new. semanticResults do: [:ea | ea keysAndValuesDo: [:k :v | sum at: k put: (sum at: k ifAbsent: [0]) + v]]. - sum := (sum withValuesSorted: #yourself descending) keys. + sum := (sum talkSemanticWithValuesSorted: #yourself descending) keys. results := (searchers gather: [:searcher | searcher filter: sum]) withoutDuplicates. diff --git a/packages/SqueakInboxTalkExtras-Semantics.package/TalkSemanticAgent.class/methodProperties.json b/packages/SqueakInboxTalkExtras-Semantics.package/TalkSemanticAgent.class/methodProperties.json index 4482dd6..c5112bd 100644 --- a/packages/SqueakInboxTalkExtras-Semantics.package/TalkSemanticAgent.class/methodProperties.json +++ b/packages/SqueakInboxTalkExtras-Semantics.package/TalkSemanticAgent.class/methodProperties.json @@ -10,4 +10,4 @@ "inbox:" : "ct 6/19/2024 17:10", "initializeConversation:" : "ct 6/8/2024 00:28", "openResults:" : "ct 6/7/2024 21:04", - "searchExact:semantic:" : "ct 6/19/2024 17:59" } } + "searchExact:semantic:" : "ct 6/20/2024 01:06" } }