tsroten / pynlpir

A Python wrapper around the NLPIR/ICTCLAS Chinese segmentation software.
MIT License
566 stars 135 forks source link

Add user part of speech tags. #88

Closed tsroten closed 7 years ago

tsroten commented 7 years ago

This adds user-defined part of speech tags. For example:

import pynlpir

my_pos_tags = pynlpir.pos_map.POS_MAP
my_pos_tags['g'] = ('专有名词', 'proper noun')

pynlpir.open()
s = '......'
pynlpir.segment(s, pos_tags=my_pos_tags)