diff options
author | J38 <jebolton@stanford.edu> | 2019-03-11 09:20:16 +0300 |
---|---|---|
committer | J38 <jebolton@stanford.edu> | 2019-03-17 08:40:56 +0300 |
commit | d4055ade983c0fad2b814c0310a762397362b5f4 (patch) | |
tree | 7c005e3fd4161a58459575d280616284cbf25f18 /demo | |
parent | 954b2d13db1bdb4a0370f808a14531375f781198 (diff) |
add value example
Diffstat (limited to 'demo')
-rw-r--r-- | demo/corenlp.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/demo/corenlp.py b/demo/corenlp.py index 2f4e8a2b..6e9b0b64 100644 --- a/demo/corenlp.py +++ b/demo/corenlp.py @@ -33,6 +33,16 @@ with CoreNLPClient(annotators=['tokenize','ssplit','pos','lemma','ner','parse',' constituency_parse = sentence.parseTree print(constituency_parse) + # get the first subtree of the constituency parse + print('---') + print('first subtree of constituency parse') + print(constituency_parse.child[0]) + + # get the value of the first subtree + print('---') + print('value of first subtree of constituency parse') + print(constituency_parse.child[0].value) + # get the first token of the first sentence print('---') print('first token of first sentence') |