rhoknp.processors.processor module¶
- class rhoknp.processors.processor.Processor[source]¶
Bases:
ABC解析器の基底クラス.
- apply(text: str, timeout: int = 10) Document[source]¶
- apply(text: Sentence, timeout: int = 10) Sentence
- apply(text: Document, timeout: int = 10) Document
テキストに解析器を適用する.
- Parameters:
text – 解析するテキスト.
timeout – 最大処理時間.
- Raises:
TypeError – textの型がstr, Sentence, Document以外の場合.
Note
このメソッドは引数の型に応じて
apply_to_documentまたはapply_to_sentenceを呼び出す. 引数の型がstrの場合はapply_to_documentを呼び出す. 引数の型がSentenceの場合はapply_to_sentenceを呼び出す. 引数の型がDocumentの場合はapply_to_documentを呼び出す.