Discourse

class corpustools.corpus.classes.spontaneous.Discourse(kwargs)[source]

Discourse objects are collections of linear text with word tokens

Parameters
namestr

Identifier for the Discourse

speakerSpeaker

Speaker producing the tokens/text (defaults to an empty Speaker)

Attributes
attributeslist of Attributes

The Discourse object tracks all of the attributes used by its WordToken objects

wordsdict of WordTokens

The keys are the beginning times of the WordTokens (or their place in a text if it’s not a speech discourse) and the values are the WordTokens

Methods

__init__(kwargs)

add_attribute(attribute[, initialize_defaults])

Add an Attribute of any type to the Discourse or replace an existing Attribute.

add_word(wordtoken)

Adds a WordToken to the Discourse

create_lexicon()

Create a Corpus object from the Discourse

find_wordtype(wordtype)

Look up all WordTokens that are instances of a Word

keys()

Returns a sorted list of keys for looking up WordTokens

random_word()