From a60965fe95b7dd9747c5a251d8272a73a8afabda Mon Sep 17 00:00:00 2001 From: David de Hilster Date: Fri, 8 Dec 2023 22:36:24 -0500 Subject: [PATCH] VISUALTEXT-FILES-083 Added ability to call Python scripts on text Signed-off-by: David de Hilster --- python/DeAccent.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 python/DeAccent.py diff --git a/python/DeAccent.py b/python/DeAccent.py new file mode 100644 index 0000000..b7ca931 --- /dev/null +++ b/python/DeAccent.py @@ -0,0 +1,14 @@ +# Deacent words in the current text + +import sys + +from unidecode import unidecode + +file_path = sys.argv[1] + +with open(file_path, encoding='utf8') as f: + file_text = f.read() + +text_without_accents = unidecode(file_text) + +print(text_without_accents) \ No newline at end of file