pyknp_eventgraph.base_phrase

class pyknp_eventgraph.base_phrase.BasePhrase(event, tag, ssid, bid, tid, is_child=False, exophora='', omitted_case='')[source]

Bases: pyknp_eventgraph.component.Component

A wrapper of pyknp.knp.tag.Tag, which allow exophora to be a base phrase. BasePhrase is a bidirectional linked list; each of base phrases has its parent and children.

event: Event

An event that has this base phrase.

tag: Tag, optional

A tag.

ssid: int

A serial sentence ID.

bid: int

A serial bunsetsu ID.

tid: int

A serial tag ID.

is_child: bool

If true, this base phrase is a child of a head base phrase.

exophora: str

An exophora.

omitted_case: str

A omitted case.

parent: BasePhrase, optional

A parent base phrase.

children: List[BasePhrase]

A list of child base phrases.

modifiees(include_self=False)[source]

Return a list of base phrases modified by this base phrase.

Parameters

include_self (bool) – If true, include this base phrase to the return.

Return type

List[BasePhrase]

modifiers(include_self=False)[source]

Return a list of base phrases modifying this base phrase.

Parameters

include_self (bool) – If true, include this base phrase to the return.

Return type

List[BasePhrase]

to_dict()[source]

Convert this object into a dictionary.

Return type

dict

to_list()[source]

Expand to a list.

Return type

List[BasePhrase]

to_string()[source]

Convert this object into a string.

Return type

str

property adnominal_events

A list of events modifying this predicate (adnominal).

Return type

List[ForwardRef]

property is_event_end

True if this base phrase is the end of an event.

Return type

bool

property is_event_head

True if this base phrase is the head of an event.

Return type

bool

property key

A key used for sorting.

Return type

Tuple[int, int, int, int]

property morphemes
Return type

List[Union[str, Morpheme]]

property root

Return the root of this base phrase.

Return type

BasePhrase

property sentential_complement_events

A list of events modifying this predicate (sentential complement).

Return type

List[ForwardRef]

property surf

A surface string.

Return type

str