Skip to content

Commit

Permalink
CharacterSet hot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SimulatedANeal committed May 29, 2018
1 parent da5b491 commit 22bd5d2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion carpedm/data/lang.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class CharacterSet(object):

__metaclass__ = abc.ABCMeta

def __init__(self, charset):
def __init__(self, charset, name=None):
"""Initializer
Args:
Expand All @@ -81,6 +81,13 @@ def __init__(self, charset):
e.g. U+3055, or unicode characters.
"""
self._ranges = self._unicode_ranges(charset)
if name:
self.name = name
elif isinstance(charset, str):
self.name = charset
else:
assert isinstance(charset, list)
self.name = 'chars'

@property
def presets(self):
Expand Down

0 comments on commit 22bd5d2

Please sign in to comment.