rhoknp.props.named_entity module

class rhoknp.props.named_entity.NamedEntityCategory(value)[source]

Bases: Enum

固有表現カテゴリを表す列挙体.

ORGANIZATION = 'ORGANIZATION'
PERSON = 'PERSON'
LOCATION = 'LOCATION'
ARTIFACT = 'ARTIFACT'
DATE = 'DATE'
TIME = 'TIME'
MONEY = 'MONEY'
PERCENT = 'PERCENT'
OPTIONAL = 'OPTIONAL'
classmethod has_value(value: str) bool[source]

有効な固有表現カテゴリであれば True.

Parameters:

value – 固有表現のカテゴリ.

class rhoknp.props.named_entity.NamedEntity(category: NamedEntityCategory, morphemes: list[Morpheme])[source]

Bases: object

固有表現を表すクラス.

PAT: ClassVar[Pattern] = re.compile('<NE:(?P<cat>\\w+):(?P<name>([^>\\\\]|\\\\>?)+)>')
category: NamedEntityCategory
morphemes: list[Morpheme]
property text: str

固有表現の表層文字列.

classmethod from_fstring(fstring: str, candidate_morphemes: list[Morpheme]) NamedEntity | None[source]

KNP における素性文字列からオブジェクトを作成.

to_fstring() str[source]

素性文字列に変換.