Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
[DOC] doc fix for vocab.subwords (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
liusy182 authored and eric-haibin-lin committed Aug 18, 2019
1 parent 5d25058 commit 2842799
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/gluonnlp/vocab/subwords.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __len__(self):
"""Return the number of subwords modeled."""
raise NotImplementedError

def indices_to_subwords(self, indices):
def indices_to_subwords(self, subwordindices):
"""Return list of subwords associated with subword indices.
This may raise RuntimeError if the subword function is not invertible.
Expand Down Expand Up @@ -135,11 +135,9 @@ def __len__(self):
def __repr__(self):
return 'ByteSubwords(encoding={})'.format(self.encoding)

def indices_to_subwords(self, indices):
def indices_to_subwords(self, subwordindices):
"""Return list of subwords associated with subword indices.
This may raise RuntimeError if the subword function is not invertible.
Parameters
----------
subwordindices : iterable of int
Expand All @@ -150,7 +148,7 @@ def indices_to_subwords(self, indices):
Iterable of str.
"""
return indices
return subwordindices

def subwords_to_indices(self, subwords):
"""Return list of subwordindices associated with subwords.
Expand Down Expand Up @@ -280,10 +278,8 @@ def __len__(self):
def __repr__(self):
return ('NGramHashes(num_subwords={}, ngrams={})'.format(self.num_subwords, self.ngrams))

def indices_to_subwords(self, indices):
"""Return list of subwords associated with subword indices.
This may raise RuntimeError if the subword function is not invertible.
def indices_to_subwords(self, subwordindices):
"""This raises RuntimeError because the subword function is not invertible.
Parameters
----------
Expand Down

0 comments on commit 2842799

Please sign in to comment.