diff options
Diffstat (limited to 'learn_torch/rnn_demo.py')
| -rw-r--r-- | learn_torch/rnn_demo.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/learn_torch/rnn_demo.py b/learn_torch/rnn_demo.py new file mode 100644 index 0000000..667949f --- /dev/null +++ b/learn_torch/rnn_demo.py @@ -0,0 +1,25 @@ +from io import open +import glob +import os + +import unicodedata +import string + + +all_letters = string.ascii_letters + " .,;'" +n_letters = len(all_letters) + + +def findFiles(path): return glob.glob(path) + +def unicodeToAscii(s): + return ''.join( + c for c in unicodedata.normalize('NFD', s) + if unicodedata.category(c) != 'Mn' + and c in all_letters + ) + +print(unicodeToAscii('Ślusàrski')) + + +print(findFiles('text_data/names/*.txt')) |
