segram.semantic.story module

class segram.semantic.story.Story(corpus: Corpus | None = None, **kwds: Frame)[source]

Bases: object

Story class.

corpus

Document corpus.

property docs: DataIterator[Doc]

Grammar documents in the story.

property sents: DataIterator[Sent]

Grammar sentences in the story.

property phrases: DataIterator[Phrase]

Phrase in the story.

classmethod from_texts(nlp: Language, *texts: str, **kwds: Any) Self[source]

Construct from texts.

All arguments are passed to segram.nlp.Corpus().

to_data() dict[str, Any][source]

Dump to data dictionary.

classmethod from_data(data: dict[str, Any]) Self[source]

Construct from data dictionary.