From 4e37402323c3227e90a89345387834e149732b5c Mon Sep 17 00:00:00 2001 From: "trevor.cohn" Date: Fri, 9 Jul 2010 16:42:01 +0000 Subject: Make git-svn-id: https://ws10smt.googlecode.com/svn/trunk@203 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/posterior-regularisation/prjava/src/hmm/HMM.java | 7 +++++-- gi/posterior-regularisation/prjava/src/hmm/POS.java | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'gi/posterior-regularisation/prjava/src/hmm') diff --git a/gi/posterior-regularisation/prjava/src/hmm/HMM.java b/gi/posterior-regularisation/prjava/src/hmm/HMM.java index 1c4d7659..17a4679f 100644 --- a/gi/posterior-regularisation/prjava/src/hmm/HMM.java +++ b/gi/posterior-regularisation/prjava/src/hmm/HMM.java @@ -1,5 +1,8 @@ package hmm; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; import java.io.PrintStream; import java.util.ArrayList; import java.util.Scanner; @@ -248,8 +251,8 @@ public class HMM { } } - public void writeModel(String modelFilename){ - PrintStream ps=io.FileUtil.openOutFile(modelFilename); + public void writeModel(String modelFilename) throws FileNotFoundException, IOException{ + PrintStream ps=io.FileUtil.printstream(new File(modelFilename)); ps.println(trans.length); ps.println("Initial Probabilities:"); for(int i=0;i")); - PrintStream ps= io.FileUtil.openOutFile(predFilename); + PrintStream ps= io.FileUtil.printstream(new File(predFilename)); int [][]data=test.getAllData(); for(int i=0;i