Spaces:
Running
Running
Update extract_red_text.py
Browse files- extract_red_text.py +5 -1
extract_red_text.py
CHANGED
|
@@ -4,7 +4,11 @@ import json
|
|
| 4 |
import sys
|
| 5 |
from docx import Document
|
| 6 |
from docx.oxml.ns import qn
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
import unicodedata # if not already imported
|
| 9 |
|
| 10 |
MONTHS = r"(January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec)"
|
|
|
|
| 4 |
import sys
|
| 5 |
from docx import Document
|
| 6 |
from docx.oxml.ns import qn
|
| 7 |
+
try:
|
| 8 |
+
from .master_key import TABLE_SCHEMAS, HEADING_PATTERNS, PARAGRAPH_PATTERNS
|
| 9 |
+
except ImportError:
|
| 10 |
+
# When running as a script directly
|
| 11 |
+
from master_key import TABLE_SCHEMAS, HEADING_PATTERNS, PARAGRAPH_PATTERNS
|
| 12 |
import unicodedata # if not already imported
|
| 13 |
|
| 14 |
MONTHS = r"(January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec)"
|