forked from hankcs/HanLP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemoPosTagging.java
More file actions
32 lines (29 loc) · 1009 Bytes
/
DemoPosTagging.java
File metadata and controls
32 lines (29 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* <summary></summary>
* <author>He Han</author>
* <email>hankcs.cn@gmail.com</email>
* <create-date>2014/12/7 20:14</create-date>
*
* <copyright file="DemoPosTagging.java" company="上海林原信息科技有限公司">
* Copyright (c) 2003-2014, 上海林原信息科技有限公司. All Right Reserved, http://www.linrunsoft.com/
* This source is subject to the LinrunSpace License. Please contact 上海林原信息科技有限公司 to get more information.
* </copyright>
*/
package com.hankcs.demo;
import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.seg.Segment;
/**
* 词性标注
* @author hankcs
*/
public class DemoPosTagging
{
public static void main(String[] args)
{
String text = "教授正在教授自然语言处理课程";
Segment segment = HanLP.newSegment();
System.out.println("未标注:" + segment.seg(text));
segment.enablePartOfSpeechTagging(true);
System.out.println("标注后:" + segment.seg(text));
}
}