diff --git a/Tree.py b/Tree.py index e3b20b6..10d1d4f 100644 --- a/Tree.py +++ b/Tree.py @@ -575,3 +575,6 @@ def create_output_string_upos(tree): def create_output_string_xpos(tree): return tree.xpos.get_value() + +def create_output_string_feats(tree): + return tree.feats_complete.get_value() diff --git a/dependency-parsetree.py b/dependency-parsetree.py index 37c7181..9375ecd 100644 --- a/dependency-parsetree.py +++ b/dependency-parsetree.py @@ -8,7 +8,7 @@ import re import pyconll -from Tree import Tree, create_output_string_form, create_output_string_deprel, create_output_string_lemma, create_output_string_upos, create_output_string_xpos +from Tree import Tree, create_output_string_form, create_output_string_deprel, create_output_string_lemma, create_output_string_upos, create_output_string_xpos, create_output_string_feats # for separate searches of feats # feats_list = [ @@ -250,7 +250,7 @@ def main(): # set filters - assert config.get('settings', 'node_type') in ['deprel', 'lemma', 'upos', 'xpos', 'form'], '"node_type" is not set up correctly' + assert config.get('settings', 'node_type') in ['deprel', 'lemma', 'upos', 'xpos', 'form', 'feats'], '"node_type" is not set up correctly' if config.get('settings', 'node_type') == 'deprel': create_output_string_funct = create_output_string_deprel elif config.get('settings', 'node_type') == 'lemma': @@ -259,6 +259,8 @@ def main(): create_output_string_funct = create_output_string_upos elif config.get('settings', 'node_type') == 'xpos': create_output_string_funct = create_output_string_xpos + elif config.get('settings', 'node_type') == 'feats': + create_output_string_funct = create_output_string_feats else: create_output_string_funct = create_output_string_form