分词

来源:互联网 发布:ubuntu智能手机 编辑:程序博客网 时间:2024/04/20 11:07
访问 http://maven.nlpcn.org/org/ansj/ 最好下载最新版 ansj_seg/
如果你用的是1.x版本需要下载tree_split.jar。
如果你用的是2.x版本需要下载nlp-lang.jar。

如果你用的是3.x以上版本只需要下载 ansj_seg-[version]-all-in-one.jar 一个jar包就行。


 public List<String> wordDictionary() {
        List<String> wordDic = new ArrayList<>();
        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;

        try {

                //读取数据库信息

                }

catch()

          {

             }

finally

       {

           }

}



  List<String> wordDic = wordDictionary();
        for (int i = 0; i < wordDic.size(); i++) {
            UserDefineLibrary.insertWord(wordDic.get(i),"n",1000)

     }

 

public String toStringWithOutNature() {
        return this.toStringWithOutNature(",");
    }





原创粉丝点击