X hits on this document

Powerpoint document

Python for NLP and the Natural Language Toolkit - page 40 / 47

157 views

0 shares

0 downloads

0 comments

40 / 47

Example (continued)

# How does initial letter affect word length?      for token in tokens:                                     outcome = len(token.type())

  ...            condition = token.type()[0].lower()            ...           cfdist[condition].inc(outcome)

What are the condition and the outcome?

Condition = the initial letter of the token

Outcome = its word length

Document info
Document views157
Page views157
Page last viewedWed Jan 18 16:39:02 UTC 2017
Pages47
Paragraphs392
Words1978

Comments