http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9153
Revision: 9153
Author: a_engels
Date: 2011-04-09 06:29:19 +0000 (Sat, 09 Apr 2011)
Log Message:
-----------
simplifying logic
Modified Paths:
--------------
trunk/pywikipedia/spellcheck.py
Modified: trunk/pywikipedia/spellcheck.py
===================================================================
--- trunk/pywikipedia/spellcheck.py 2011-04-09 06:28:00 UTC (rev 9152)
+++ trunk/pywikipedia/spellcheck.py 2011-04-09 06:29:19 UTC (rev 9153)
@@ -112,12 +112,7 @@
for i in xrange(11):
simwords[i] = []
for alt in knownwords.keys():
- if basetext:
- if basetext not in alt.lower() == -1:
- dothis = False
- else:
- dothis = True
- else: dothis = True
+ dothis = not basetext or basetext in alt.lower()
if dothis:
diff = distance(string,alt)
if diff < 11: