Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Allzweckmesser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Messerschleifer
Allzweckmesser
Commits
a796dbfe
Commit
a796dbfe
authored
6 years ago
by
Simon Will
Browse files
Options
Downloads
Patches
Plain Diff
Print errors on stderr instead of stdout
parent
303aa71e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
allzweckmesser/corpus.py
+2
-1
2 additions, 1 deletion
allzweckmesser/corpus.py
allzweckmesser/dev.py
+3
-1
3 additions, 1 deletion
allzweckmesser/dev.py
scripts/extract_verses_by_meters.py
+3
-1
3 additions, 1 deletion
scripts/extract_verses_by_meters.py
with
8 additions
and
3 deletions
allzweckmesser/corpus.py
+
2
−
1
View file @
a796dbfe
...
...
@@ -3,6 +3,7 @@
import
logging
import
re
import
os.path
import
sys
import
traceback
from
bs4
import
BeautifulSoup
...
...
@@ -122,7 +123,7 @@ def reconstruct_verse_text_from_reading(reading):
codepoints
[
token
.
span
[
0
]:
token
.
span
[
1
]]
=
token
.
text
except
Exception
:
print
(
'
ERROR reconstructing verse from reading {!r}
'
.
format
(
reading
))
.
format
(
reading
)
,
file
=
sys
.
stderr
)
traceback
.
print_exc
()
codepoints
=
[]
return
''
.
join
(
codepoints
)
...
...
This diff is collapsed.
Click to expand it.
allzweckmesser/dev.py
+
3
−
1
View file @
a796dbfe
...
...
@@ -4,6 +4,7 @@
import
argparse
import
json
import
random
import
sys
import
traceback
from
typing
import
List
...
...
@@ -33,7 +34,8 @@ def dev(reference_verses, number=10, randomize=False) -> List[Verse]:
analysis
=
scanner
.
scan_verses
([
unidecode
(
ref
.
text
)])[
0
]
except
Exception
:
errors
+=
1
print
(
'
ERROR at verse {}
'
.
format
(
ref
.
text
))
print
(
'
ERROR at verse {}
'
.
format
(
ref
.
text
),
file
=
sys
.
stderr
)
traceback
.
print_exc
()
continue
all_analyses
.
append
(
analysis
)
...
...
This diff is collapsed.
Click to expand it.
scripts/extract_verses_by_meters.py
+
3
−
1
View file @
a796dbfe
...
...
@@ -4,6 +4,7 @@
import
argparse
import
json
import
os
import
sys
import
traceback
import
allzweckmesser
as
azm
...
...
@@ -27,7 +28,8 @@ def main(hypotactic_dir, top_out_dir, meters=['hexameter']):
'
w
'
)
as
f
:
json
.
dump
(
verses_for_meter
,
f
)
except
Exception
:
print
(
'
ERROR at document {}
'
.
format
(
document
.
title
))
print
(
'
ERROR at document {}
'
.
format
(
document
.
title
),
file
=
sys
.
stdderr
)
traceback
.
print_exc
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment