summaryrefslogtreecommitdiff
path: root/learn_torch/rnn_demo.py
diff options
context:
space:
mode:
authorzhang <zch921005@126.com>2022-05-04 08:47:54 +0800
committerzhang <zch921005@126.com>2022-05-04 08:47:54 +0800
commit2180c68999eb8dc0c7bcec015b2703f5b8b20223 (patch)
tree3ec71623038ff8b90a5bc4e32da14a7382d42d9d /learn_torch/rnn_demo.py
parent70aebb73b81b50911e2107cd4519e69f09971021 (diff)
ndarray axis
Diffstat (limited to 'learn_torch/rnn_demo.py')
-rw-r--r--learn_torch/rnn_demo.py25
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'))