comparison MPIWGThesaurus.py @ 47:b5d89c03f958

fix unicode problem with thes_quote.
author casties
date Thu, 28 Nov 2013 17:17:23 +0100
parents 7c1782d65c9b
children 5d636ba6b9cb
comparison
equal deleted inserted replaced
46:7c1782d65c9b 47:b5d89c03f958
26 import transaction 26 import transaction
27 import random 27 import random
28 import urllib2 28 import urllib2
29 import urllib 29 import urllib
30 import json 30 import json
31 import md5
31 32
32 from SrvTxtUtils import utf8ify 33 from SrvTxtUtils import utf8ify
33 34
34 class projectHolder: 35 class projectHolder:
35 projectHolder="" 36 projectHolder=""
772 773
773 def getTitle(self,entry): 774 def getTitle(self,entry):
774 return entry.title 775 return entry.title
775 776
776 def thes_quote(self,txt): 777 def thes_quote(self,txt):
777 import md5 778 logging.debug("@*%s*@"%repr(txt))
778 logging.debug("@*%s*@"%txt) 779 return md5.md5(utf8ify(txt.lower())).hexdigest()
779 return md5.md5(txt.lower()).hexdigest()
780 780
781 781
782 def formatTag(self,tag): 782 def formatTag(self,tag):
783 splitted= tag.split("_") 783 splitted= tag.split("_")
784 return splitted[-1] 784 return splitted[-1]