Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorJ38 <jebolton@stanford.edu>2019-03-11 09:20:16 +0300
committerJ38 <jebolton@stanford.edu>2019-03-17 08:40:56 +0300
commitd4055ade983c0fad2b814c0310a762397362b5f4 (patch)
tree7c005e3fd4161a58459575d280616284cbf25f18 /demo
parent954b2d13db1bdb4a0370f808a14531375f781198 (diff)
add value example
Diffstat (limited to 'demo')
-rw-r--r--demo/corenlp.py10
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')