diff options
author | Aylur <[email protected]> | 2024-10-24 20:25:33 +0000 |
---|---|---|
committer | Aylur <[email protected]> | 2024-10-24 20:25:51 +0000 |
commit | e6250c7a4366da033d98a67b426ae5e08aa6f712 (patch) | |
tree | 459d34c9764a3777549dbfe5649009f8f956fde1 /lib/apps/application.vala | |
parent | 306e64998c1bf1fb997c1098ae92d6edfef31cd2 (diff) |
lib(apps): make scoring mechanism public
resolves #54
Diffstat (limited to 'lib/apps/application.vala')
-rw-r--r-- | lib/apps/application.vala | 10 |
1 files changed, 8 insertions, 2 deletions
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; |