manuskript/src/functions.py

20 lines
379 B
Python
Raw Normal View History

2015-06-05 06:22:37 +12:00
#!/usr/bin/env python
#--!-- coding: utf8 --!--
from __future__ import print_function
from __future__ import unicode_literals
def wordCount(text):
2015-06-05 21:37:01 +12:00
return len(text.strip().split(" ")) if text else 0
def toInt(text):
if text:
return int(text)
else:
return 0
def toFloat(text):
if text:
return float(text)
else:
return 0.