Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
ansjsun committed Aug 31, 2016
1 parent 5e3f725 commit 105a110
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<version>0.0.1</version>
<packaging>pom</packaging>
<name>plug-template</name>
<description>the plugin of ansj_seg for the third party</description>

<licenses>
<license>
Expand Down
38 changes: 21 additions & 17 deletions src/test/java/org/ansj/test/TestError.java
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
package org.ansj.test;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import org.ansj.dic.LearnTool;
import org.ansj.domain.Term;
import org.ansj.library.DATDictionary;
import org.ansj.domain.Result;
import org.ansj.library.UserDefineLibrary;
import org.ansj.recognition.impl.NatureRecognition;
import org.ansj.splitWord.analysis.IndexAnalysis;
import org.ansj.splitWord.analysis.NlpAnalysis;
import org.ansj.splitWord.analysis.ToAnalysis;
import org.ansj.util.MyStaticValue;
import org.ansj.splitWord.analysis.DicAnalysis;
import org.junit.Test;
import org.nlpcn.commons.lang.tire.GetWord;
import org.nlpcn.commons.lang.tire.domain.Forest;
import org.nlpcn.commons.lang.tire.domain.Value;
import org.nlpcn.commons.lang.tire.library.Library;

public class TestError {

@Test
public void test() throws Exception {

Forest forest = new Forest();

UserDefineLibrary.insertWord("中性粒细胞百分数neut%","clear",2000);
UserDefineLibrary.insertWord("中性粒细胞百分数neut","clear",2000);
UserDefineLibrary.insertWord("neut%","clear",2000);

String str = "2中性粒细胞百分数NEUT%70.2040.00--75.00%" ;
System.out.println(ToAnalysis.parse(str));
Library.insertWord(forest, "苹果果醋\t10\t10");
Library.insertWord(forest, "苹果\t10 10");
Library.insertWord(forest, "苹果醋 10 10");
Library.insertWord(forest, "果醋 10 10");

UserDefineLibrary.FOREST=forest;

Result re = DicAnalysis.parse("发扬光大对方地方看苹果醋");
System.out.println(re);


// UserDefineLibrary.insertWord("中性粒细胞百分数neut%","clear",2000);
// UserDefineLibrary.insertWord("中性粒细胞百分数neut","clear",2000);
// UserDefineLibrary.insertWord("neut%","clear",2000);
//
// String str = "2中性粒细胞百分数NEUT%70.2040.00--75.00%" ;
// System.out.println(ToAnalysis.parse(str));

// LearnTool tool = new LearnTool();
// System.out.println(NlpAnalysis.parse("这次回家,我经济南下广州", tool));
Expand Down

0 comments on commit 105a110

Please sign in to comment.