summaryrefslogtreecommitdiff
path: root/lib/MaildirIndexer/Index/ByAddresses.rakumod
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2020-03-16 15:33:39 +0000
committerdakkar <dakkar@thenautilus.net>2020-03-16 15:34:19 +0000
commit6bc735051d38c1f84acaa40d8e724398e50dcc90 (patch)
tree216bb751b33a54a2f104bc0c80b4acf89d715e07 /lib/MaildirIndexer/Index/ByAddresses.rakumod
parentactually working cache updating in ByAddresses (diff)
downloadMaildirIndexer-6bc735051d38c1f84acaa40d8e724398e50dcc90.tar.gz
MaildirIndexer-6bc735051d38c1f84acaa40d8e724398e50dcc90.tar.bz2
MaildirIndexer-6bc735051d38c1f84acaa40d8e724398e50dcc90.zip
indices can now return confidence levelsbayes
also, tests pass again
Diffstat (limited to 'lib/MaildirIndexer/Index/ByAddresses.rakumod')
-rw-r--r--lib/MaildirIndexer/Index/ByAddresses.rakumod6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/MaildirIndexer/Index/ByAddresses.rakumod b/lib/MaildirIndexer/Index/ByAddresses.rakumod
index 0b77d15..033f4e9 100644
--- a/lib/MaildirIndexer/Index/ByAddresses.rakumod
+++ b/lib/MaildirIndexer/Index/ByAddresses.rakumod
@@ -110,14 +110,14 @@ submethod predict-mailbox-given-addresses(@addresses) {
return %prediction;
}
-method mailbox-for-email(MaildirIndexer::Email:D $email --> Str) {
- my Str $result;
+method mailbox-for-email(MaildirIndexer::Email:D $email --> Mailbox) {
+ my Mailbox $result;
MaildirIndexer::LogTimelineSchema::Index::Find.log: :class('ByAddresses'), -> {
my %prediction = self.predict-mailbox-given-addresses($email.addresses);
my @most-probable-mailboxes = %prediction.pairs.sort(*.value);
- if @most-probable-mailboxes -> $_ { $result = .[*-1].key }
+ if @most-probable-mailboxes -> $_ { $result = Mailbox.new(:name(.key),:confidence(.value)) with .[*-1] }
}
return $result;
}