diff --git a/modules/Babelfish.py b/modules/Babelfish.py
index d75273c..d09a701 100644
--- a/modules/Babelfish.py
+++ b/modules/Babelfish.py
@@ -35,9 +35,7 @@ class Babelfish(Module):
"""Handle IRC input."""
match = re.search('^!translate\s+(\S+)\s+(\S+)\s+(.*)$', what)
- print(what)
if match:
- print('match')
fromlang = match.group(1)
tolang = match.group(2)
text = match.group(3)
@@ -60,9 +58,9 @@ class Babelfish(Module):
req.add_header('Accept-Charset', 'UTF-8,*;q=0.5')
res = urllib2.urlopen(req)
content = res.read()
- start_idx = content.find('
', start_idx)
translation = content[start_idx:end_idx]
# do some text conversion
@@ -71,13 +69,14 @@ class Babelfish(Module):
translation = translation.replace('<', '<')
translation = translation.replace('>', '>')
translation = translation.replace(''', '\'')
- translation = text.replace('< ', '<') # crappy attempt at undoing the safety above
+ translation = translation.replace(''', '\'')
+ translation = translation.replace('< ', '<') # crappy attempt at undoing the safety above
return translation
if __name__ == '__main__':
babelfish = Babelfish(None, None, None)
- print('\'' + babelfish.translate('en', 'ja', '') + '\'')
+ print('\'' + babelfish.translate('en', 'ja', 'i can\'t read it, there aren\'t any words there') + '\'')
# vi:tabstop=4:expandtab:autoindent
# kate: indent-mode python;indent-width 4;replace-tabs on;