From 0d1d84630a08f1c901cf09b4bcc9356c4165302f 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 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gi/posterior-regularisation/prjava/src/hmm/HMM.java') 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