speechTokens: Vectors of Tokens for all Speeches According to Speaker

Description Usage Details Author(s) References See Also

Description

Given a proxy for a play, act or scene object in Python, or for a list of speeches, the function returns a named list, with names being the speakers. The corresponding element is a list of tokens as produced by the word_tokenizer() function in Python, converting the speeches by this speaker into a stream of tokens.

Usage

1
speechTokens(speeches, .get = NA)

Details

This function extends the proxy for a Python function of the same name and argument. If the optional argument .get is TRUE, the value returned by the Python function is converted and the lines for each speech are unlisted into a character vector.

Author(s)

John M. Chambers

References

Chambers, John M. (2016) Extending R, Chapman & Hall/CRC.

See Also

tokens This returns the same information but in one vector for the tokens in all speeches.


johnmchambers/shakespeare documentation built on May 19, 2019, 5:16 p.m.