ckipnlp.util.ws module¶
-
class
ckipnlp.util.ws.
WsWord
[source]¶ Bases:
tuple
A word-segmented word.
-
word
¶ str – the word.
-
pos
¶ str – the post-tag.
-
classmethod
from_text
(text)[source]¶ Create a
WsWord
object fromckipnlp.ws.CkipWs
output.Parameters: text (str) – A word from ckipnlp.ws.CkipWs
output.
-
-
class
ckipnlp.util.ws.
WsSentence
(initlist=None)[source]¶ Bases:
collections.UserList
A word-segmented sentence.
-
classmethod
from_text
(text)[source]¶ Create
WsSentence
object fromckipnlp.ws.CkipWs
output.Parameters: text (str) – A sentence from ckipnlp.ws.CkipWs
output.
-
classmethod
-
class
ckipnlp.util.ws.
WsSentenceList
(initlist=None)[source]¶ Bases:
collections.UserList
A list of word-segmented sentence.
-
item_class
¶ alias of
WsSentence
-
classmethod
from_text
(text_list)[source]¶ Create
WsSentenceList
object fromckipnlp.ws.CkipWs
output.Parameters: text_list (List[str]) – A list of sentence from ckipnlp.ws.CkipWs
output.
-