From c588e8997dffc7e8dbf0f54b94c79261314ae2d8 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 26 Nov 2006 06:20:09 +0000 Subject: r9810@Kushana: nickm | 2006-11-26 01:19:14 -0500 Code cleanups suggested by pychecker; some quite brain-dead. svn:r187 --- metaphone.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'metaphone.py') diff --git a/metaphone.py b/metaphone.py index e86d4fc..8eb8257 100644 --- a/metaphone.py +++ b/metaphone.py @@ -9,8 +9,6 @@ Based on the original C++ metaphone implementation.) """ -import string - TRIPLES = { 'dge': 'j', 'dgi': 'j', @@ -62,7 +60,7 @@ def metaphone(s): # Change "x" to "s" if s[0] == 'x': - x = "s%s" % s[1:] + s = "s%s" % s[1:] # Get rid of "h" in "wh". if s[:2] == 'wh': @@ -118,15 +116,13 @@ def metaphone(s): vowelBefore = prevLtr in "aeiou" curLtr = s[idx] - nextLtr2 = nextLtr3 = ' ' + nextLtr2 = ' ' if idx < lastChar: nextLtr = s[idx+1] vowelAfter = nextLtr in "aeiou" frontvAfter = nextLtr in "eiy" if idx+1 < lastChar: nextLtr2 = s[idx+2] - if idx+2 < lastChar: - nextLtr3 = s[idx+3] else: nextLtr = ' ' vowelAfter = frontvAfter = 0 -- cgit v1.2.3-70-g09d2