Skip to content

Commit

Permalink
suppress errors in aml/augly/text
Browse files Browse the repository at this point in the history
Differential Revision: D53096609

fbshipit-source-id: a3d0aa34fd340b267b31ff75eb4a40b9af10fa4d
  • Loading branch information
generatedunixname89002005307016 authored and facebook-github-bot committed Jan 26, 2024
1 parent 3ab3393 commit c98450b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions augly/text/augmenters/fun_fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def apply_font(self, text: str, font: Union[str, dict], method: str) -> str:

def substitute(self, data: str) -> str:
tokens = tokenize(data)
# pyre-fixme[20]: Argument `k` expected.
font = random.sample(self.fonts, 1)[0]
results = []

Expand All @@ -119,6 +120,7 @@ def substitute(self, data: str) -> str:
continue

if self.vary_fonts:
# pyre-fixme[20]: Argument `k` expected.
font = random.sample(self.fonts, 1)[0]

results.append(self.apply_font(token, font, Method.WORD))
Expand All @@ -134,6 +136,7 @@ def substitute(self, data: str) -> str:

for char in chars:
if self.vary_fonts:
# pyre-fixme[20]: Argument `k` expected.
font = random.sample(self.fonts, 1)[0]
if char_idx not in aug_char_idxes:
result += char
Expand Down

0 comments on commit c98450b

Please sign in to comment.