Rename parsers to DATE_REGEX

In moving the `parsers` variable into the package-level, it lost the
context, so a more descriptive name was needed.
This commit is contained in:
Daniel Quinn
2018-09-09 21:02:30 +01:00
parent 69fc0d6d80
commit ef7f98281d
3 changed files with 7 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ from pyocr.libtesseract.tesseract_raw import \
from pyocr.tesseract import TesseractError
import pdftotext
from documents.parsers import DocumentParser, ParseError, pattern
from documents.parsers import DocumentParser, ParseError, DATE_REGEX
from .languages import ISO639
@@ -211,7 +211,7 @@ class RasterisedDocumentParser(DocumentParser):
return None
# Iterate through all regex matches and try to parse the date
for m in re.finditer(pattern, text):
for m in re.finditer(DATE_REGEX, text):
datestring = m.group(0)
try: