Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed code #212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions book/ch05.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Using a Tagger
A part-of-speech tagger, or `POS-tagger`:dt:, processes a sequence of words, and attaches a
part of speech tag to each word (don't forget to ``import nltk``):

>>> text = word_tokenize("And now for something completely different")
>>> text = nltk.word_tokenize("And now for something completely different")
>>> nltk.pos_tag(text)
[('And', 'CC'), ('now', 'RB'), ('for', 'IN'), ('something', 'NN'),
('completely', 'RB'), ('different', 'JJ')]
Expand All @@ -83,7 +83,7 @@ Here we see that `and`:lx: is ``CC``, a coordinating conjunction;

Let's look at another example, this time including some homonyms:

>>> text = word_tokenize("They refuse to permit us to obtain the refuse permit")
>>> text = nltk.word_tokenize("They refuse to permit us to obtain the refuse permit")
>>> nltk.pos_tag(text)
[('They', 'PRP'), ('refuse', 'VBP'), ('to', 'TO'), ('permit', 'VB'), ('us', 'PRP'),
('to', 'TO'), ('obtain', 'VB'), ('the', 'DT'), ('refuse', 'NN'), ('permit', 'NN')]
Expand Down