Package org.fnlp.nlp.similarity.train

Examples of org.fnlp.nlp.similarity.train.WordCluster


 

  @Test
  public void testStartClustering() {
    WordCluster wc = new WordCluster();
    wc.slotsize =6;
    String[] strs = new String[]{"猪肉","狗肉","狗头","鸡头","猪头","鸡肉"};
    StringReader r = new StringReader(strs );
    wc.read(r);

    try {
      Cluster root = wc.startClustering();
      DrawTree.printTree(root,"../tmp/t.png");
      wc.saveModel("../tmp/t.m");
      wc.saveTxt("../tmp/t.txt");
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (Exception e) {
      // TODO Auto-generated catch block
View Full Code Here

TOP

Related Classes of org.fnlp.nlp.similarity.train.WordCluster

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.