Commit 1d5a3ddf authored by di68kap's avatar di68kap

- kleine Korrekturenim OM-Tabellen Konvertierungsskript

parent cecfaf10
DHParser-submodule @ f2ffe00d
Subproject commit 90aa9fc29431ebe83862b33a4628c3a38ea8c261
Subproject commit f2ffe00d30b619505ea70217fd45ba9626239832
......@@ -207,6 +207,8 @@ def erzeuge_autoren_regex(autoren_menge: set) -> str:
def schreibe_autoren_syntax_hilighting(restr: str):
print(f'Trage regulären Ausdruck für die Autorennamen in der '
f'Syntax-Highlighting-Datei "{tmLanguage_pfad}" ein.')
with open(tmLanguage_pfad, 'r', encoding='utf-8') as f:
tmLanguage = json.load(f)
tmLanguage['repository']['opera_majora_author_name']['patterns'][0]['match'] = restr
......@@ -220,9 +222,15 @@ if __name__ == "__main__":
# autoren = {'AY', 'BX', 'CW', 'DV', 'EU'}
restr = erzeuge_autoren_regex(autoren)
schreibe_autoren_syntax_hilighting(restr)
# rx = re.compile(restr)
# print(rx.match('LIGURINUS'))
# import timeit
# print(timeit.timeit("rx.match('LIGURINUS')", number=1_000_000, globals=globals()))
schreibe_schnipsel_json(opera_majora)
print('fertig :-)')
# begin test-code
print('\n\nTest des regulären Ausdrucks für die Autorennamen:')
rx = re.compile(restr)
print("Finde LIGURINUS: ", rx.match('LIGURINUS'))
import timeit
print("Zeitmessung: 1 Mio mal LIGURINUS finden: ",
timeit.timeit("rx.match('LIGURINUS')", number=1_000_000, globals=globals()))
# end test-code
print('\nfertig :-)')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment