Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

Commit 4b23eb8

Browse files
committed
Update the README and zpar_example.py
- Include an example of parsing an already tagged sentence.
1 parent 058d374 commit 4b23eb8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ Here's a small example of how to use python-zpar:
107107
tagged_sent = tagger.tag_sentence("Do n't you want to come with me to the market ?", tokenize=False)
108108
print_(tagged_sent)
109109
110-
# get the dependency parses of the same two sentences
111-
dep_parsed_sent = depparser.dep_parse_sentence("I am going to the market.")
110+
# get the dependency parse of an already tagged sentence
111+
dep_parsed_sent = depparser.dep_parse_tagged_sentence("I/PRP am/VBP going/VBG to/TO the/DT market/NN ./.")
112112
print_(dep_parsed_sent)
113113
114+
# get the dependency parse of an already tokenized sentence
114115
dep_parsed_sent = depparser.dep_parse_sentence("Do n't you want to come with me to the market ?", tokenize=False)
115116
print_(dep_parsed_sent)
116117

examples/zpar_example.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@
3131
tagged_sent = tagger.tag_sentence("Do n't you want to come with me to the market ?", tokenize=False)
3232
print_(tagged_sent)
3333

34-
# get the dependency parses of the same two sentences
35-
dep_parsed_sent = depparser.dep_parse_sentence("I am going to the market.")
34+
# get the dependency parse of an already tagged sentence
35+
dep_parsed_sent = depparser.dep_parse_tagged_sentence("I/PRP am/VBP going/VBG to/TO the/DT market/NN ./.")
3636
print_(dep_parsed_sent)
3737

38+
# get the dependency parse of an already tokenized sentence
3839
dep_parsed_sent = depparser.dep_parse_sentence("Do n't you want to come with me to the market ?", tokenize=False)
3940
print_(dep_parsed_sent)
4041

0 commit comments

Comments
 (0)