more tweaks
This commit is contained in:
parent
c7648de3bc
commit
b7afd57890
@ -22,6 +22,15 @@ def isIncorp(text):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def extractMarker(text):
|
||||||
|
textList = text.split(' ')
|
||||||
|
for word in textList:
|
||||||
|
if word[-1] == '#':
|
||||||
|
return word
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def extractOperation(text):
|
def extractOperation(text):
|
||||||
operationList = ['send', 'transfer', 'give'] # keep everything lowercase
|
operationList = ['send', 'transfer', 'give'] # keep everything lowercase
|
||||||
count = 0
|
count = 0
|
||||||
@ -53,14 +62,6 @@ def extractAmount(text):
|
|||||||
return 'Too many'
|
return 'Too many'
|
||||||
return returnval
|
return returnval
|
||||||
|
|
||||||
|
|
||||||
def extractMarker(text):
|
|
||||||
textList = text.split(' ')
|
|
||||||
for word in textList:
|
|
||||||
if word[-1] == '#':
|
|
||||||
return word
|
|
||||||
return False
|
|
||||||
|
|
||||||
def extractInitTokens(text):
|
def extractInitTokens(text):
|
||||||
base_units = {'thousand':10**3 , 'million':10**6 ,'billion':10**9, 'trillion':10**12}
|
base_units = {'thousand':10**3 , 'million':10**6 ,'billion':10**9, 'trillion':10**12}
|
||||||
textList = text.split(' ')
|
textList = text.split(' ')
|
||||||
@ -91,7 +92,7 @@ def parse_flodata(string):
|
|||||||
'amount': amount}
|
'amount': amount}
|
||||||
elif isIncorp(cleanstring):
|
elif isIncorp(cleanstring):
|
||||||
incMarker = extractMarker(cleanstring)
|
incMarker = extractMarker(cleanstring)
|
||||||
initTokens = extractAmount(cleanstring)
|
initTokens = extractInitTokens(cleanstring)
|
||||||
parsed_data = {'type': 'incorporation', 'flodata': string, 'marker': incMarker, 'initTokens': initTokens}
|
parsed_data = {'type': 'incorporation', 'flodata': string, 'marker': incMarker, 'initTokens': initTokens}
|
||||||
else:
|
else:
|
||||||
parsed_data = {'type': 'noise'}
|
parsed_data = {'type': 'noise'}
|
||||||
|
|||||||
@ -25,6 +25,9 @@
|
|||||||
<p>marker : {{ parsed_data['marker'] }}</p>
|
<p>marker : {{ parsed_data['marker'] }}</p>
|
||||||
<p>initTokens : {{ parsed_data['initTokens'] }}</p>
|
<p>initTokens : {{ parsed_data['initTokens'] }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if parsed_data['type'] == 'noise' %}
|
||||||
|
<p>type : {{ parsed_data['type'] }}</p>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
------------------
|
------------------
|
||||||
<form action="" method="post" name="reporterror">
|
<form action="" method="post" name="reporterror">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user