segram.grammar.conjuncts module
- class segram.grammar.conjuncts.PhraseGroup(iterable=(), /)[source]
Bases:
DataTupleGroup of phrases.
- class segram.grammar.conjuncts.Conjuncts(members: Iterable[Phrase] = (), *, lead: int = 0, cconj: Token | None = None, preconj: Token | None = None)[source]
Bases:
DataTupleGroup of conjoined phrases.
- members
Conjoined phrases.
- lead
Lead component.
- cconj
Conjunction token.
- preconj
Preconjunction token.
- classmethod from_data(sent: Sent, data: dict[str, int | list[int] | None]) Self[source]
Construct from data dictionary.
- Parameters:
sent – Sentence object.
data – Data dictionary.
cdict – Mapping from ordinal numbers to components.
- to_data() dict[str, int | list[int] | None][source]
Dump to data dictionary.
- Parameters:
odict – Mapping from components to their ordinal numbers within the sentence sequence.
- Returns:
Dictionary with list of components ordinal numbers and and index of the conjunction token, or
None.- Return type:
data