Search in sources :

Example 11 with Keyword

use of org.ansj.app.keyword.Keyword in project ansj_seg by NLPchina.

the class TagWordTest method test.

@Test
public void test() {
    TagContent tw = new TagContent("<em>", "</em>");
    String content = "abc123中国人";
    List<Keyword> keywords = new ArrayList<Keyword>();
    keywords.add(new Keyword("中国人民", 1.0));
    keywords.add(new Keyword("中国", 1.0));
    keywords.add(new Keyword("abc", 1.0));
    keywords.add(new Keyword("abc12", 1.0));
    System.out.println(tw.tagContent(keywords, content));
}
Also used : Keyword(org.ansj.app.keyword.Keyword) ArrayList(java.util.ArrayList) TagContent(org.ansj.app.summary.TagContent) Test(org.junit.Test)

Aggregations

Keyword (org.ansj.app.keyword.Keyword)11 ArrayList (java.util.ArrayList)7 Test (org.junit.Test)5 KeyWordComputer (org.ansj.app.keyword.KeyWordComputer)2 TagContent (org.ansj.app.summary.TagContent)2 SmartForest (org.nlpcn.commons.lang.tire.domain.SmartForest)2 Summary (org.ansj.app.summary.pojo.Summary)1 Term (org.ansj.domain.Term)1 SmartGetWord (org.nlpcn.commons.lang.tire.SmartGetWord)1 MapCount (org.nlpcn.commons.lang.util.MapCount)1