From e6250c7a4366da033d98a67b426ae5e08aa6f712 Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 24 Oct 2024 20:25:33 +0000 Subject: lib(apps): make scoring mechanism public resolves #54 --- lib/apps/application.vala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/apps/application.vala') diff --git a/lib/apps/application.vala b/lib/apps/application.vala index ea22e7a..4b4fc44 100644 --- a/lib/apps/application.vala +++ b/lib/apps/application.vala @@ -69,7 +69,10 @@ public class AstalApps.Application : Object { } } - internal Score fuzzy_match(string term) { + /** + * Calculate a score for an application using fuzzy matching algorithm. + */ + public Score fuzzy_match(string term) { var score = Score(); if (name != null) score.name = fuzzy_match_string(term, name); @@ -83,7 +86,10 @@ public class AstalApps.Application : Object { return score; } - internal Score exact_match(string term) { + /** + * Calculate a score using exact string algorithm. + */ + public Score exact_match(string term) { var score = Score(); if (name != null) score.name = name.down().contains(term.down()) ? 1 : 0; -- cgit v1.2.3