diff --git a/wani.py b/wani.py index b4fb3fb..76def42 100644 --- a/wani.py +++ b/wani.py @@ -20,7 +20,7 @@ except ImportError: tqdm = lambda x: x -MAX_NUM_COMPONENTS = 5 +MAX_NUM_COMPONENTS = -1 CODES = { "Noun": "N", @@ -782,12 +782,17 @@ def load_structures(filename): return build_structures(et), get_lemma_features(et) def build_structures(et): + global MAX_NUM_COMPONENTS + structures = [] for structure in et.iter('syntactic_structure'): to_append = SyntacticStructure.from_xml(structure) if to_append is None: continue + structures.append(to_append) + MAX_NUM_COMPONENTS = max(MAX_NUM_COMPONENTS, len(to_append.components)) + return structures def get_lemma_features(et):