[kupfer] relevance: Clean up doctests and remove redundant
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] relevance: Clean up doctests and remove redundant
- Date: Sun, 13 Sep 2009 01:11:27 +0000 (UTC)
commit 3c62420340da2ea78bea7e528594da704f7453e3
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Sun Sep 13 02:17:05 2009 +0200
relevance: Clean up doctests and remove redundant
kupfer/relevance.py | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/kupfer/relevance.py b/kupfer/relevance.py
index 6fc17f1..36494a6 100644
--- a/kupfer/relevance.py
+++ b/kupfer/relevance.py
@@ -100,10 +100,6 @@ def score(s, query):
0.0
>>> print score('terminal', '')
1.0
- >>> print score('terminal', 'yl')
- 0.0
- >>> print score('terminal', 'tlm')
- 0.0
"""
if not query:
return 1.0
@@ -177,16 +173,12 @@ def _findBestMatch(s, query):
Returns: a two-item tuple containing the start and end indicies of
the match. No match returns (-1,-1).
- >>> _findBestMatch('terminal', 'yl')
- (-1, -1)
- >>> _findBestMatch('terminal', 'term')
- (0, 4)
>>> _findBestMatch('terminal', 'trml')
(0, 8)
- >>> _findBestMatch('teerminal', 'erml')
- (2, 9)
- >>> _findBestMatch('terminal', 'e')
- (1, 2)
+ >>> _findBestMatch('total told', 'tl')
+ (2, 5)
+ >>> _findBestMatch('terminal', 'yl')
+ (-1, -1)
"""
bestMatch = -1, -1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]