Search in sources :

Example 6 with DijkstraSegment

use of com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment in project HanLP by hankcs.

the class TestNTRecognition method testSeg.

public void testSeg() throws Exception {
    HanLP.Config.enableDebug();
    DijkstraSegment segment = new DijkstraSegment();
    segment.enableCustomDictionary(false);
    segment.enableOrganizationRecognize(true);
    System.out.println(segment.seg("东欧的球队"));
}
Also used : DijkstraSegment(com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment)

Example 7 with DijkstraSegment

use of com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment in project HanLP by hankcs.

the class TestMakeJapaneseName method testRecognize.

public void testRecognize() throws Exception {
    HanLP.Config.enableDebug();
    DijkstraSegment segment = new DijkstraSegment();
    System.out.println(segment.seg("我叫大杉亚依里"));
}
Also used : DijkstraSegment(com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment)

Example 8 with DijkstraSegment

use of com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment in project HanLP by hankcs.

the class TestMakeJapaneseName method testSeg.

public void testSeg() throws Exception {
    HanLP.Config.enableDebug();
    DijkstraSegment segment = new DijkstraSegment();
    segment.enableJapaneseNameRecognize(true);
    System.out.println(segment.seg("林志玲亮相网友:确定不是波多野结衣?"));
}
Also used : DijkstraSegment(com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment)

Example 9 with DijkstraSegment

use of com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment in project HanLP by hankcs.

the class TestMakeTranslateName method testNonRec.

public void testNonRec() throws Exception {
    HanLP.Config.enableDebug();
    DijkstraSegment segment = new DijkstraSegment();
    segment.enableTranslatedNameRecognize(true);
    System.out.println(segment.seg("汤姆和杰克逊"));
}
Also used : DijkstraSegment(com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment)

Example 10 with DijkstraSegment

use of com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment in project HanLP by hankcs.

the class TestMakeCompanyCorpus method testCase.

public void testCase() throws Exception {
    HanLP.Config.enableDebug();
    DijkstraSegment segment = new DijkstraSegment();
    segment.enableOrganizationRecognize(true);
    System.out.println(segment.seg("黑龙江建筑职业技术学院近百学生发生冲突"));
}
Also used : DijkstraSegment(com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment)

Aggregations

DijkstraSegment (com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment)18 Segment (com.hankcs.hanlp.seg.Segment)5 Term (com.hankcs.hanlp.seg.common.Term)5 CRFSegment (com.hankcs.hanlp.seg.CRF.CRFSegment)3 DoubleArrayTrieSegment (com.hankcs.hanlp.seg.Other.DoubleArrayTrieSegment)3 ViterbiSegment (com.hankcs.hanlp.seg.Viterbi.ViterbiSegment)3 NShortSegment (com.hankcs.hanlp.seg.NShort.NShortSegment)2 ResultTerm (com.hankcs.hanlp.seg.common.ResultTerm)1 File (java.io.File)1 List (java.util.List)1