testing new config

This commit is contained in:
2019-02-27 17:04:03 +01:00
6 changed files with 94 additions and 67 deletions

View File

@@ -4,6 +4,7 @@ from parser.msd.msdmap import Msdmap
import pickle
from pathlib import Path
from fillpred_model.step1 import build_model_row
import sys
class Parser:
# reads a TEI xml file and returns a dictionary:
@@ -18,8 +19,12 @@ class Parser:
self.W_TAGS = ['w']
self.C_TAGS = ['c']
self.S_TAGS = ['S', 'pc']
with Path("./fillpred_model/model.pickle").open("rb") as fp:
try:
fp = Path("./fillpred_model/model.pickle").open("rb")
self.fillpred_model = pickle.load(fp)
except IOError:
print("Generate the model first: $ make tools/fillpred_mode/model.pickle")
sys.exit(1)
def parse_tei(self, filepath):