Archived
1
0

Added regular expressions to clean up temperature data

This commit is contained in:
Bas Vb 2014-04-22 09:46:19 +02:00
parent be63315ca2
commit b0146cdce8

View File

@ -47,8 +47,13 @@ class WikipediaParser(Parser):
def cleanitems(self, items):
for item in items:
value=item['value']
if re.match('3(...)', value):
print value
if re.search('F;\s(\d+[\.,]?\d*)', value):
#print re.search('F;\s(\d+[\.,]?\d*)', value).group(1)
item['value']=re.search('F;\s(\d+[\.,]?\d*)', value).group(1) + " K"
if re.match('(\d+[\.,]?\d*)\sJ\sK.+mol', value):
print item['value']
item['value']=re.search('(\d+[\.,]?\d*)\sJ\sK.+mol', value).group(1) + " J/K/mol"
print item['value']
return items
def getboilingpoint(self, sel):