[kupfer] data: Bonus rank fixedrank objects in Searcher
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] data: Bonus rank fixedrank objects in Searcher
- Date: Sun, 23 Aug 2009 11:28:55 +0000 (UTC)
commit 5702cffa4c229397731a5fa43b976be28e6a8374
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Sun Aug 23 04:25:40 2009 +0200
data: Bonus rank fixedrank objects in Searcher
This way learning is applied to fixedrank objects; this means we can
promote text leaves and URL/File text matches with learning.
kupfer/data.py | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/kupfer/data.py b/kupfer/data.py
index ea84d38..bf59557 100644
--- a/kupfer/data.py
+++ b/kupfer/data.py
@@ -84,11 +84,10 @@ class Searcher (object):
if not rankables:
rankables = search.make_rankables(items)
- if fixedrank:
- # we have a given rank
- matches = search.add_rank_objects(rankables, fixedrank)
- elif score:
- if key:
+ if score:
+ if fixedrank:
+ rankables = search.add_rank_objects(rankables, fixedrank)
+ elif key:
rankables = search.score_objects(rankables, key)
matches = search.bonus_objects(rankables, key)
if isinstance(src, objects.Source):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]