Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
ocrtypoworkflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ocrtypo
ocrtypoworkflow
Commits
1df480ed
Commit
1df480ed
authored
Mar 31, 2020
by
Christian Reul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added NFC normalization in combinegt
parent
b6b6c9a1
Pipeline
#21868
passed with stage
in 6 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
ocrtypoworkflow/combinegt.py
ocrtypoworkflow/combinegt.py
+3
-1
No files found.
ocrtypoworkflow/combinegt.py
View file @
1df480ed
...
...
@@ -5,6 +5,7 @@ from ocrtypoworkflow.ocrtypoalign.datastructs import Result, DisplayChar, Charac
from
ocrtypoworkflow.util.io
import
glob_all
from
ocrtypoworkflow.util.multiprocessing
import
parallel_map
import
json
import
unicodedata
class
SingleProcessArgs
(
NamedTuple
):
ocr
:
str
...
...
@@ -19,7 +20,7 @@ def run_single(args: SingleProcessArgs):
try
:
data
=
{
'ocr'
:
open
(
ocr
).
read
(
),
'ocr'
:
unicodedata
.
normalize
(
'NFC'
,
open
(
ocr
).
read
()
),
'typo1'
:
open
(
typo1
).
read
(),
'typo2'
:
open
(
typo2
).
read
(),
}
...
...
@@ -37,6 +38,7 @@ def run_single(args: SingleProcessArgs):
lens
=
list
(
map
(
len
,
data
.
values
()))
if
any
(
lens
[
0
]
!=
l
for
l
in
lens
):
print
(
"Invalid lengths {} in files"
.
format
(
lens
,
ocr
))
print
(
ocr
)
comb
.
isCorrected
=
True
comb
.
corrected
=
[
...
...
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