Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MLW-DSL
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
badw-it
MLW-DSL
Commits
1d5a3ddf
Commit
1d5a3ddf
authored
Aug 14, 2019
by
di68kap
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- kleine Korrekturenim OM-Tabellen Konvertierungsskript
parent
cecfaf10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
DHParser-submodule
DHParser-submodule
+1
-1
konvertiere_opera_majora_tabelle.py
konvertiere_opera_majora_tabelle.py
+13
-5
No files found.
DHParser-submodule
@
f2ffe00d
Subproject commit
90aa9fc29431ebe83862b33a4628c3a38ea8c261
Subproject commit
f2ffe00d30b619505ea70217fd45ba9626239832
konvertiere_opera_majora_tabelle.py
View file @
1d5a3ddf
...
...
@@ -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\n
Test 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
(
'
\n
fertig :-)'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment