summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbladictionary.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bladictionary.py b/bladictionary.py
index ec5aff9..936a75b 100755
--- a/bladictionary.py
+++ b/bladictionary.py
@@ -6,7 +6,7 @@ import sys
import shlex
from lxml import etree
-version = "2.0.7b"
+version = "2.0.8b"
class Definition(object):
#ID is relative to the word type, eg noun 1, noun 2, verb 1, verb 2, not to the entire list
@@ -42,9 +42,6 @@ def get_xml(word, word_dict):
root = element
break;
- for element in root.iter("{http://services.aonaware.com/webservices/}WordDefinition"):
- print element.text
-
return root
def parse_xml(xml):
@@ -94,7 +91,10 @@ def parse_xml(xml):
if id_parts[0].isdigit() != True:
word_type = id_parts[0]
- id = id_parts[1]
+ if len(id_parts) < 2:
+ id = 1
+ else :
+ id = id_parts[1]
definition = line_parts[1].strip() + " "
else:
id = id_parts[0]
@@ -231,7 +231,7 @@ def main():
num_more+=1
else:
definition = item.word_type + " " + str(item.id) + ": " + item.definition
- if line_length + len(definition) > 455:
+ if line_length + len(definition) > 458:
suppress_print = True
num_more+= 1
else: