findPlay: Get a Play as a Parsed XML Object

Description Usage Arguments Details

Description

Given a character string that identifies one of Shakespeare's plays, this function returns a pointer to the parsed XML version of the play. More prescisely, the returned value is a proxy for a Python object resulting from parsing the corresponding file.

Usage

1

Arguments

name

a character string identifying the play. Ideally this is the key under which the play is stored, but it can also be any string that uniquely matches one of the play titles. To see keys and titles, call playTitles().

ask

if more than one play matches the name, should the user be asked to choose. Default TRUE iff the session is interactive. No resolution of multiple matches generates an error.

get

should the play be parsed if it has not been previously? default TRUE.

Details

The text of the XML version of the plays (a contribution from Jon Bosak, available from https://www.ibiblio.org/xml/examples/shakespeare/) are included with this package. In an R session, the first call to getPlay() matching a particular play will parse the file (in Python) and return the proxy to the corresponding Python object. The proxy is also saved in a table so that multiple calls for the same play will only parse once.

This function uses a proxy for the Python function of the same name (which exists in the package as well, under the name getPlay_Python.


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