From 443d45c5605e00e85e1f1f6d040bbb0da0ccdea3 Mon Sep 17 00:00:00 2001 From: ldolse Date: Tue, 28 Sep 2010 16:21:34 +0800 Subject: [PATCH] ... --- src/calibre/ebooks/conversion/preprocess.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/conversion/preprocess.py b/src/calibre/ebooks/conversion/preprocess.py index 960dbf0242..6e83146527 100644 --- a/src/calibre/ebooks/conversion/preprocess.py +++ b/src/calibre/ebooks/conversion/preprocess.py @@ -191,13 +191,13 @@ class Dehyphenator(object): lookupword = self.removesuffixes.sub('', dehyphenated) if self.prefixes.match(firsthalf) is None: lookupword = self.removeprefix.sub('', lookupword) - print "lookup word is: "+str(lookupword)+", orig is: " + str(hyphenated) + #print "lookup word is: "+str(lookupword)+", orig is: " + str(hyphenated) try: searchresult = self.html.find(str.lower(lookupword)) except: return hyphenated if self.format == 'html_cleanup': - if self.html.find(lookupword) != -1 or self.html.find(str.lower(lookupword)) != -1: + if self.html.find(lookupword) != -1 or searchresult != -1: #print "Cleanup:returned dehyphenated word: " + str(dehyphenated) return dehyphenated elif self.html.find(hyphenated) != -1: @@ -208,11 +208,11 @@ class Dehyphenator(object): return firsthalf+u'\u2014'+wraptags+secondhalf else: - if self.html.find(lookupword) != -1 or self.html.find(str.lower(lookupword)) != -1: + if self.html.find(lookupword) != -1 or searchresult != -1: #print "returned dehyphenated word: " + str(dehyphenated) return dehyphenated else: - #print "returned hyphenated word: " + str(hyphenated) + #print " returned hyphenated word: " + str(hyphenated) return hyphenated def __call__(self, html, format, length=1):