update git.ignore and remorse-generate-function
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,3 +3,5 @@
|
|||||||
/data-extended/
|
/data-extended/
|
||||||
/Hilfsprogramme/
|
/Hilfsprogramme/
|
||||||
/.idea/
|
/.idea/
|
||||||
|
/data/t9-de.dic
|
||||||
|
/data/morse-de.dic
|
||||||
@@ -2355,7 +2355,7 @@ befinden.
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
wbfile = open("./data/german.dic", "r",
|
wbfile = open("./data/german.dic", "r",
|
||||||
encoding="iso-8859-15") # german.dic von https://sourceforge.net/projects/germandict/
|
encoding="iso-8859-1") # german.dic von https://sourceforge.net/projects/germandict/
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
Ausgabe.insert(1.0, hilfetext + "\n")
|
Ausgabe.insert(1.0, hilfetext + "\n")
|
||||||
else:
|
else:
|
||||||
@@ -2396,7 +2396,7 @@ befinden.
|
|||||||
Ausgabe.insert(1.0, hilfetext + "\n")
|
Ausgabe.insert(1.0, hilfetext + "\n")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
wbfile = open("./data/german.dic", "r", encoding="iso-8859-15")
|
wbfile = open("./data/german.dic", "r", encoding="iso-8859-1")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
Ausgabe.insert(1.0, hilfetext + "\n")
|
Ausgabe.insert(1.0, hilfetext + "\n")
|
||||||
else:
|
else:
|
||||||
@@ -2524,7 +2524,7 @@ im Unterverzeichnis "data" befinden.
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
wbfile = open("./data/morse-de.dic", "r",
|
wbfile = open("./data/morse-de.dic", "r",
|
||||||
encoding="iso-8859-15") # german.dic von https://sourceforge.net/projects/germandict/
|
encoding="iso-8859-1") # german.dic von https://sourceforge.net/projects/germandict/
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
try:
|
try:
|
||||||
testfile = open("./data/german.dic", "r")
|
testfile = open("./data/german.dic", "r")
|
||||||
@@ -2573,7 +2573,7 @@ def remorse_germandic():
|
|||||||
ualphabet["...--.."] = "ß"
|
ualphabet["...--.."] = "ß"
|
||||||
eingabetext = Eingabe.get(1.0, END)
|
eingabetext = Eingabe.get(1.0, END)
|
||||||
eingabetext = eingabetext.rstrip()
|
eingabetext = eingabetext.rstrip()
|
||||||
wbfile = open("./data/german.dic", "r", encoding="iso-8859-15")
|
wbfile = open("./data/german.dic", "r", encoding="iso-8859-1")
|
||||||
Ausgabe.insert(1.0, "\n")
|
Ausgabe.insert(1.0, "\n")
|
||||||
for zeile in wbfile:
|
for zeile in wbfile:
|
||||||
zeile = zeile.strip(" \t\n\r")
|
zeile = zeile.strip(" \t\n\r")
|
||||||
@@ -2602,24 +2602,19 @@ def remorse_generate_morsede():
|
|||||||
'?': '..--..', '=': '-...-', ';': '-.-.-.', ':': '---...', '/': '-..-.',
|
'?': '..--..', '=': '-...-', ';': '-.-.-.', ':': '---...', '/': '-..-.',
|
||||||
'.': '.-.-.-', '-': '-....-', ',': '--..--', '+': '.-.-.', ')': '-.--.-',
|
'.': '.-.-.-', '-': '-....-', ',': '--..--', '+': '.-.-.', ')': '-.--.-',
|
||||||
'(': '-.--.', "'": '.----.', 'SS': '...--..'}
|
'(': '-.--.', "'": '.----.', 'SS': '...--..'}
|
||||||
ofile = open("./data/morse-de.dic", "a", encoding="iso-8859-15")
|
with open("./data/morse-de.dic", "w", encoding="iso-8859-1") as ofile:
|
||||||
ofile.write("-----,0\n.----,1\n..---,2\n...--,3\n....-,4\n.....,5\n-....,6\n--...,7\n---..,8\n----.,9\n")
|
for symbol, morse in alphabet.items():
|
||||||
ofile.write(".-,A\n-...,B\n-.-.,C\n-..,D\n.,E\n..-.,F\n--.,G\n....,H\n..,I\n.---,J\n-.-,K\n.-..,L\n--,M\n")
|
ofile.write(f"{morse},{symbol}\n")
|
||||||
ofile.write("-.,N\n---,O\n.--.,P\n--.-,Q\n.-.,R\n...,S\n-,T\n..-,U\n...-,V\n.--,W\n-..-,X\n-.--,Y\n--..,Z\n")
|
with open("./data/german.dic", "r", encoding="iso-8859-1") as infile:
|
||||||
ofile.write("--.--,Ñ\n..-..,É\n.-..-,È\n.--.-,À\n..--,Ü\n---.,Ö\n.-.-,Ä\n..--.-,_\n.--.-.,@\n..--..,?\n-...-,=\n")
|
for line in infile:
|
||||||
ofile.write("-.-.-.,;\n---...,:\n-..-.,/\n.-.-.-,.\n-....-,-\n.-.-.,+\n-.--.-,)\n-.--.,(\n.----.,'\n...--..,ß\n")
|
word = line.strip()
|
||||||
file = open("./data/german.dic", "r", encoding="iso-8859-15")
|
try:
|
||||||
for zeile in file:
|
morse_word = ''.join(alphabet[char.upper()] for char in word)
|
||||||
omsg = ""
|
ofile.write(f"{morse_word},{word}\n")
|
||||||
zeile = zeile.rstrip()
|
except KeyError:
|
||||||
try:
|
# Überspringe Wörter mit nicht-unterstützten Zeichen
|
||||||
for char in zeile:
|
continue
|
||||||
omsg = omsg + alphabet[char.upper()]
|
infile.close()
|
||||||
except TypeError:
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
ofile.write(omsg + "," + zeile + "\n")
|
|
||||||
file.close()
|
|
||||||
ofile.close()
|
ofile.close()
|
||||||
|
|
||||||
|
|
||||||
@@ -2703,7 +2698,7 @@ im Unterverzeichnis "data" befinden.
|
|||||||
Ausgabe.insert(1.0, hilfetext + "\n")
|
Ausgabe.insert(1.0, hilfetext + "\n")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
wbfile = open("./data/t9-de.dic", "r", encoding="iso-8859-15")
|
wbfile = open("./data/t9-de.dic", "r", encoding="iso-8859-1")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
try:
|
try:
|
||||||
testfile = open("./data/german.dic", "r")
|
testfile = open("./data/german.dic", "r")
|
||||||
@@ -2748,7 +2743,7 @@ def t9_germandic():
|
|||||||
'-': '1', ',': '1', '+': '0', ')': '1', '(': '1', 'SS': '7'}
|
'-': '1', ',': '1', '+': '0', ')': '1', '(': '1', 'SS': '7'}
|
||||||
eingabetext = Eingabe.get(1.0, END)
|
eingabetext = Eingabe.get(1.0, END)
|
||||||
eingabetext = eingabetext.rstrip()
|
eingabetext = eingabetext.rstrip()
|
||||||
wbfile = open("./data/german.dic", "r", encoding="iso-8859-15")
|
wbfile = open("./data/german.dic", "r", encoding="iso-8859-1")
|
||||||
Ausgabe.insert(1.0, "\n")
|
Ausgabe.insert(1.0, "\n")
|
||||||
for zeile in wbfile:
|
for zeile in wbfile:
|
||||||
zeile = zeile.strip(" \t\n\r")
|
zeile = zeile.strip(" \t\n\r")
|
||||||
@@ -2773,8 +2768,8 @@ def t9_generate_t9de():
|
|||||||
'0': '0', 'Ñ': '6', 'É': '3', 'È': '3', 'À': '2', 'Ü': '8', 'Ö': '6',
|
'0': '0', 'Ñ': '6', 'É': '3', 'È': '3', 'À': '2', 'Ü': '8', 'Ö': '6',
|
||||||
'Ä': '2', '@': '1', '?': '1', '=': '0', ':': '1', '/': '1', '.': '1',
|
'Ä': '2', '@': '1', '?': '1', '=': '0', ':': '1', '/': '1', '.': '1',
|
||||||
'-': '1', ',': '1', '+': '0', ')': '1', '(': '1', 'SS': '7'}
|
'-': '1', ',': '1', '+': '0', ')': '1', '(': '1', 'SS': '7'}
|
||||||
ofile = open("./data/t9-de.dic", "a", encoding="iso-8859-15")
|
ofile = open("./data/t9-de.dic", "a", encoding="iso-8859-1")
|
||||||
file = open("./data/german.dic", "r", encoding="iso-8859-15")
|
file = open("./data/german.dic", "r", encoding="iso-8859-1")
|
||||||
for zeile in file:
|
for zeile in file:
|
||||||
omsg = ""
|
omsg = ""
|
||||||
zeile = zeile.rstrip()
|
zeile = zeile.rstrip()
|
||||||
|
|||||||
Reference in New Issue
Block a user