mirror of
https://github.com/qurator-spk/ocrd_repair_inconsistencies.git
synced 2025-06-09 19:59:59 +02:00
getLogger per method
This commit is contained in:
parent
8182063a4f
commit
93d4b652fe
1 changed files with 3 additions and 1 deletions
|
@ -22,7 +22,6 @@ from shapely.geometry import Polygon
|
||||||
from .config import OCRD_TOOL
|
from .config import OCRD_TOOL
|
||||||
|
|
||||||
TOOL = 'ocrd-repair-inconsistencies'
|
TOOL = 'ocrd-repair-inconsistencies'
|
||||||
LOG = getLogger('processor.RepairInconsistencies')
|
|
||||||
|
|
||||||
|
|
||||||
class RepairInconsistencies(Processor):
|
class RepairInconsistencies(Processor):
|
||||||
|
@ -32,6 +31,7 @@ class RepairInconsistencies(Processor):
|
||||||
super(RepairInconsistencies, self).__init__(*args, **kwargs)
|
super(RepairInconsistencies, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
|
LOG = getLogger('processor.RepairInconsistencies')
|
||||||
assert_file_grp_cardinality(self.input_file_grp, 1)
|
assert_file_grp_cardinality(self.input_file_grp, 1)
|
||||||
assert_file_grp_cardinality(self.output_file_grp, 1)
|
assert_file_grp_cardinality(self.output_file_grp, 1)
|
||||||
|
|
||||||
|
@ -118,6 +118,7 @@ class RepairInconsistencies(Processor):
|
||||||
|
|
||||||
def get_text(thing, joiner=''):
|
def get_text(thing, joiner=''):
|
||||||
"""Get the text of the given thing, joining if necessary"""
|
"""Get the text of the given thing, joining if necessary"""
|
||||||
|
LOG = getLogger('processor.RepairInconsistencies')
|
||||||
|
|
||||||
def _get_text_for_one(one):
|
def _get_text_for_one(one):
|
||||||
try:
|
try:
|
||||||
|
@ -135,6 +136,7 @@ def get_text(thing, joiner=''):
|
||||||
|
|
||||||
def _fix_segment(segment, page_id, reverse=False):
|
def _fix_segment(segment, page_id, reverse=False):
|
||||||
"""Fix order of child elements of (region/line/word) segment."""
|
"""Fix order of child elements of (region/line/word) segment."""
|
||||||
|
LOG = getLogger('processor.RepairInconsistencies')
|
||||||
|
|
||||||
if isinstance(segment, TextRegionType):
|
if isinstance(segment, TextRegionType):
|
||||||
joiner = '\n'
|
joiner = '\n'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue