Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lmjohns3/theanets
Browse files Browse the repository at this point in the history
  • Loading branch information
Leif Johnson committed Jun 3, 2018
2 parents ed61fab + 1d93e63 commit 804e909
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion theanets/recurrent.py
Expand Up @@ -88,7 +88,8 @@ def __init__(self, text, alpha=None, min_count=2, unknown='\0'):
char for char, count in
collections.Counter(text).items()
if char != unknown and count >= min_count)))
self.text = re.sub(r'[^{}]'.format(re.escape(self.alpha)), unknown, text)
self.text = re.sub(
r'[^{}]'.format(re.escape(self.alpha)), unknown, text)
assert unknown not in self.alpha
self._rev_index = unknown + self.alpha
self._fwd_index = dict(zip(self._rev_index, range(1 + len(self.alpha))))
Expand Down

0 comments on commit 804e909

Please sign in to comment.