Skip to content

Commit

Permalink
enforce pep8 in util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
renan-cunha committed Jul 18, 2021
1 parent 6438ab3 commit 20810e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from src import config
from typing import List


def char_to_idx(char: str) -> int:
return config.ALPHABET.index(char)


def sentence_to_idx(string: str) -> List[int]:
return [char_to_idx(x) for x in string]


def idx_to_char(idx: int) -> str:
return config.ALPHABET[idx]
return config.ALPHABET[idx]

0 comments on commit 20810e3

Please sign in to comment.