From 2180c68999eb8dc0c7bcec015b2703f5b8b20223 Mon Sep 17 00:00:00 2001 From: zhang Date: Wed, 4 May 2022 08:47:54 +0800 Subject: ndarray axis --- learn_torch/rnn_demo.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 learn_torch/rnn_demo.py (limited to 'learn_torch/rnn_demo.py') 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')) -- cgit v1.2.3