Search in sources :

Example 1 with SegmentWrapper

use of com.hankcs.hanlp.seg.common.wrapper.SegmentWrapper in project HanLP by hankcs.

the class TestSegment method testWrapper.

public void testWrapper() throws Exception {
    SegmentWrapper wrapper = new SegmentWrapper(new BufferedReader(new StringReader("中科院预测科学研究中心学术委员会\nhaha")), StandardTokenizer.SEGMENT);
    Term fullTerm;
    while ((fullTerm = wrapper.next()) != null) {
        System.out.println(fullTerm);
    }
}
Also used : BufferedReader(java.io.BufferedReader) StringReader(java.io.StringReader) Term(com.hankcs.hanlp.seg.common.Term) ResultTerm(com.hankcs.hanlp.seg.common.ResultTerm) SegmentWrapper(com.hankcs.hanlp.seg.common.wrapper.SegmentWrapper)

Aggregations

ResultTerm (com.hankcs.hanlp.seg.common.ResultTerm)1 Term (com.hankcs.hanlp.seg.common.Term)1 SegmentWrapper (com.hankcs.hanlp.seg.common.wrapper.SegmentWrapper)1 BufferedReader (java.io.BufferedReader)1 StringReader (java.io.StringReader)1