able to load pickled structures
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from xml.etree import ElementTree
|
||||
import logging
|
||||
import pickle
|
||||
|
||||
from component import Component, ComponentType
|
||||
from lemma_features import get_lemma_features
|
||||
@@ -92,7 +93,12 @@ class SyntacticStructure:
|
||||
return [] if matches is None else matches
|
||||
|
||||
|
||||
def build_structures(filename):
|
||||
def build_structures(args):
|
||||
filename = args.structures
|
||||
if args.pickled_structures:
|
||||
with open(filename, 'rb') as fp:
|
||||
return pickle.load(fp)
|
||||
|
||||
max_num_components = -1
|
||||
with open(filename, 'r') as fp:
|
||||
et = ElementTree.XML(fp.read())
|
||||
|
||||
Reference in New Issue
Block a user