Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pycrfsuite/_float_features.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from __future__ import print_function, absolute_import


class FloatFeatures(object):
def __init__(self, values):
if not isinstance(values, list):
raise ValueError("Values should be an instance of list()")
try:
self.values = [float(v) for v in values]
except ValueError:
print("All elements in values should be castable to type float.", file=sys.stderr)
raise
except:
print("Unexpected error:", sys.exc_info()[0])
raise
Loading