Added feats in node_type
This commit is contained in:
parent
38271016db
commit
153c19a865
3
Tree.py
3
Tree.py
|
@ -575,3 +575,6 @@ def create_output_string_upos(tree):
|
||||||
|
|
||||||
def create_output_string_xpos(tree):
|
def create_output_string_xpos(tree):
|
||||||
return tree.xpos.get_value()
|
return tree.xpos.get_value()
|
||||||
|
|
||||||
|
def create_output_string_feats(tree):
|
||||||
|
return tree.feats_complete.get_value()
|
||||||
|
|
|
@ -8,7 +8,7 @@ import re
|
||||||
|
|
||||||
import pyconll
|
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
|
# for separate searches of feats
|
||||||
# feats_list = [
|
# feats_list = [
|
||||||
|
@ -250,7 +250,7 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
# set filters
|
# 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':
|
if config.get('settings', 'node_type') == 'deprel':
|
||||||
create_output_string_funct = create_output_string_deprel
|
create_output_string_funct = create_output_string_deprel
|
||||||
elif config.get('settings', 'node_type') == 'lemma':
|
elif config.get('settings', 'node_type') == 'lemma':
|
||||||
|
@ -259,6 +259,8 @@ def main():
|
||||||
create_output_string_funct = create_output_string_upos
|
create_output_string_funct = create_output_string_upos
|
||||||
elif config.get('settings', 'node_type') == 'xpos':
|
elif config.get('settings', 'node_type') == 'xpos':
|
||||||
create_output_string_funct = create_output_string_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:
|
else:
|
||||||
create_output_string_funct = create_output_string_form
|
create_output_string_funct = create_output_string_form
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user