Skip to content

Commit

Permalink
Bugfix: pass through vocab/encoding params (ddbourgin#60)
Browse files Browse the repository at this point in the history
This appears to be a typo. I think the correct behavior is that GoodTuring should take into account a vocab and encoding if given.
  • Loading branch information
Eric Ihli authored May 25, 2021
1 parent 69b9c12 commit 9ef025f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numpy_ml/ngram/ngram.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def train(self, corpus_fp, vocab=None, encoding=None):
Specifies the text encoding for corpus. Common entries are 'utf-8',
'utf-8-sig', 'utf-16'. Default is None.
"""
self._train(corpus_fp, vocab=None, encoding=None)
self._train(corpus_fp, vocab=vocab, encoding=encoding)
self._calc_smoothed_counts()

def log_prob(self, words, N):
Expand Down

0 comments on commit 9ef025f

Please sign in to comment.