Package com.atilika.kuromoji.dict

Examples of com.atilika.kuromoji.dict.ConnectionCosts


        System.out.println("done");
    }

    private void buildConnectionCosts(String inputDirname, String outputDirname) throws IOException {
        System.out.print("building connection costs...");
        ConnectionCosts connectionCosts = ConnectionCostsBuilder.build(inputDirname + File.separator + "matrix.def");
        OutputStream os = new FileOutputStream(outputDirname + File.separator + ConnectionCosts.FILENAME);
        connectionCosts.write(os);
        os.close();
        System.out.println("done");
    }
View Full Code Here


    int forwardSize = Integer.parseInt(dimensions[0]);
    int backwardSize = Integer.parseInt(dimensions[1]);
   
    assert forwardSize > 0 && backwardSize > 0;
   
    ConnectionCosts costs = new ConnectionCosts(forwardSize, backwardSize);
   
    while ((line = lineReader.readLine()) != null) {
      String[] fields = line.split("\\s+");

      assert fields.length == 3;
     
      short forwardId = Short.parseShort(fields[0]);
      short backwardId = Short.parseShort(fields[1]);
      short cost = Short.parseShort(fields[2]);

      costs.add(forwardId, backwardId, cost);
    }
    return costs;
  }
View Full Code Here

TOP

Related Classes of com.atilika.kuromoji.dict.ConnectionCosts

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.