Skip to content

Commit

Permalink
Fix E266 too many leading '#' for block comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zuphilip committed Sep 8, 2018
1 parent 6b4c996 commit 4161f9e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions hocr-eval
Expand Up @@ -12,10 +12,10 @@ from lxml import html
from PIL import Image, ImageDraw

################################################################
### library
# library
################################################################

### XML node processing
# XML node processing


def get_prop(node, name):
Expand Down Expand Up @@ -70,7 +70,7 @@ def erode(u, tx, ty):
return tuple([u[0] + x, u[1] + y, u[2] - x, u[3] - y])


### text comparison
# text comparison

simp_re = re.compile(r'[^a-zA-Z0-9.,!?:;]+')

Expand All @@ -81,7 +81,7 @@ def normalize(s):
return s


### edit distance
# edit distance


def edit_distance(a, b, threshold=99999):
Expand Down Expand Up @@ -121,10 +121,10 @@ def remove_tex(text):


################################################################
### main program
# main program
################################################################

### argument parsing
# argument parsing

parser = argparse.ArgumentParser()
parser.add_argument(
Expand Down
12 changes: 6 additions & 6 deletions hocr-eval-geom
Expand Up @@ -9,7 +9,7 @@ import re

from lxml import html

### general utilities
# general utilities


def get_text(node):
Expand All @@ -34,7 +34,7 @@ def get_bbox(node):
return tuple([int(x) for x in bbox.split()])


### rectangle properties
# rectangle properties


def intersect(u, v):
Expand All @@ -60,10 +60,10 @@ def relative_overlap(u, v):


################################################################
### main program
# main program
################################################################

### argument parsing
# argument parsing

parser = argparse.ArgumentParser(
description=
Expand Down Expand Up @@ -96,7 +96,7 @@ parser.add_argument(
help="default: %(default)s")
args = parser.parse_args()

### read the hOCR files
# read the hOCR files

truth_doc = html.parse(args.truth)
actual_doc = html.parse(args.actual)
Expand All @@ -105,7 +105,7 @@ actual_pages = actual_doc.xpath("//*[@class='ocr_page']")
assert len(truth_pages) == len(actual_pages)
pages = zip(truth_pages, actual_pages)

### compute statistics
# compute statistics


def boxstats(truths, actuals):
Expand Down
4 changes: 2 additions & 2 deletions hocr-eval-lines
Expand Up @@ -10,7 +10,7 @@ import re
from lxml import html

################################################################
### misc library code
# misc library code
################################################################


Expand Down Expand Up @@ -55,7 +55,7 @@ def edit_distance(a, b, threshold=999999):


################################################################
### main program
# main program
################################################################

parser = argparse.ArgumentParser(
Expand Down
4 changes: 2 additions & 2 deletions hocr-merge-dc
Expand Up @@ -31,7 +31,7 @@ args = parser.parse_args()
dc_doc = etree.parse(args.dc, html.XHTMLParser())
hocr_doc = html.parse(args.hocr)

### remove all existing META tags representing Dublin Core metadata
# remove all existing META tags representing Dublin Core metadata

hocr_meta = hocr_doc.xpath("//HEAD|//head")
assert hocr_meta != []
Expand All @@ -41,7 +41,7 @@ hocr_nodes = hocr_doc.xpath("//head//meta[starts-with(@name,'DC.')]")
for node in hocr_nodes:
node.getparent().remove(node)

### find all the Dublin Core tags in the Dublin Core metadata
# find all the Dublin Core tags in the Dublin Core metadata

dc_nodes = dc_doc.xpath(
"//dc:*", namespaces={"dc": "http://purl.org/dc/elements/1.1/"})
Expand Down
2 changes: 1 addition & 1 deletion hocr-split
Expand Up @@ -9,7 +9,7 @@ import re
from lxml import etree, html

################################################################
### main program
# main program
################################################################

parser = argparse.ArgumentParser(
Expand Down

0 comments on commit 4161f9e

Please sign in to comment.