cosmel.util.word module

class cosmel.util.word.WsWords(chars)[source]

Bases: collections.abc.Sequence

The sequence of word-segmented words.

Parameters:chars (str) – the text with tag. (the format should be several ‘text(post-tag)’s seperated by <U+3000>s.)
index(word, *args)[source]

int – returns the index of the first word.

Parameters:word (tuple) – the tuple of text and tag, (optional) and role.
txts

list – the texts.

tags

list – the post-tags.

roles

list – the roles.

zip

zip – the zip iterator of the texts, the tags, and the roles. (= zip3).

zip2

zip – the zip iterator of the texts and the tags.

zip3

zip – the zip iterator of the texts, the tags, and the roles..

cosmel.util.word.txtstr(obj)[source]

str – return the string of texts (obj.txts)

cosmel.util.word.roledstr(obj)[source]

str – return the string with role (obj.txts, obj.tags, obj.roles)

cosmel.util.word.roledtxtstr(obj)[source]

str – return the string with texts and role (obj.txts, obj.roles)