Skip to content

Commit

Permalink
重构
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Dec 16, 2014
1 parent 151eeb5 commit 729b07e
Show file tree
Hide file tree
Showing 300 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions data/dictionary/CoreNatureDictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47654,10 +47654,10 @@
小丹 nrf 12
小丹阳 nz 2
小主人 nz 7
小丽 nz 216
小丽 nr 216
小乌龟 nz 5
小乐 nz 34
小乔 n 18
小乔 nr 18
小九九 n 5
小九华 nz 2
小乡村 ns 1
Expand All @@ -47675,7 +47675,7 @@
小产 v 1
小产权 nz 11
小亭 nz 2
小亮 nz 85
小亮 nr 85
小人 n 65
小人书 nz 1
小人儿 n 2
Expand Down
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<groupId>com.hankcs</groupId>
<artifactId>HanLP</artifactId>
<version>1.0</version>
<modules>
<module>HanLPLucenePlugin</module>
</modules>
<packaging>pom</packaging>

<name>HanLP</name>
<url>http://www.hankcs.com/</url>
Expand Down Expand Up @@ -55,6 +51,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
</configuration>
</plugin>
<!-- 单元测试插件 -->
<plugin>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class CRFSegment extends Segment
* @param enable
* @return
*/
public CRFSegment enableSpeechTag(boolean enable)
public CRFSegment enablePartOfSpeechTagging(boolean enable)
{
speechTagging = enable;
return this;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public static List<Term> parse(String text)
* @param enable
* @return
*/
public NShortSegment enableSpeechTag(boolean enable)
public NShortSegment enablePartOfSpeechTagging(boolean enable)
{
config.speechTagging = enable;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public Segment enableIndexMode(boolean enable)
* @param enable
* @return
*/
public Segment enableSpeechTag(boolean enable)
public Segment enablePartOfSpeechTagging(boolean enable)
{
config.speechTagging = enable;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class NLPTokenizer
*/
public static final Segment SEGMENT = new DijkstraSegment().enableNameRecognize(true).enableTranslatedNameRecognize(true)
.enableJapaneseNameRecognize(true).enablePlaceRecognize(true).enableOrganizationRecognize(true)
.enableSpeechTag(true);
.enablePartOfSpeechTagging(true);

public static List<Term> segment(String text)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class DemoCRFSegment
public static void main(String[] args)
{
Segment segment = new CRFSegment();
segment.enableSpeechTag(true);
segment.enablePartOfSpeechTagging(true);
List<Term> termList = segment.seg("你看过穆赫兰道吗");
System.out.println(termList);
for (Term term : termList)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void main(String[] args)
Segment segment = HanLP.newSegment();

System.out.println("未标注:" + segment.seg(text));
segment.enableSpeechTag(true);
segment.enablePartOfSpeechTagging(true);
System.out.println("标注后:" + segment.seg(text));
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testSegment() throws Exception
{
// HanLP.Config.enableDebug();
CRFSegment segment = new CRFSegment();
// segment.enableSpeechTag(true);
// segment.enablePartOfSpeechTagging(true);
System.out.println(segment.seg("你看过穆赫兰道吗"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void testSpeechTagging() throws Exception
DijkstraSegment segment = new DijkstraSegment();

System.out.println("未标注:" + segment.seg(text));
segment.enableSpeechTag(true);
segment.enablePartOfSpeechTagging(true);
System.out.println("标注后:" + segment.seg(text));
}

Expand Down
File renamed without changes.

0 comments on commit 729b07e

Please sign in to comment.