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/Makefile | 5 +++++ gi/posterior-regularisation/prjava/build.xml | 2 -- .../prjava/lib/jopt-simple-3.2.jar | Bin 0 -> 53244 bytes .../prjava/src/hmm/HMM.java | 7 +++++-- .../prjava/src/hmm/POS.java | 21 +++++++++++++++------ .../prjava/src/test/HMMModelStats.java | 11 ++++++++++- 6 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 gi/posterior-regularisation/prjava/Makefile create mode 100644 gi/posterior-regularisation/prjava/lib/jopt-simple-3.2.jar diff --git a/gi/posterior-regularisation/prjava/Makefile b/gi/posterior-regularisation/prjava/Makefile new file mode 100644 index 00000000..abd9b964 --- /dev/null +++ b/gi/posterior-regularisation/prjava/Makefile @@ -0,0 +1,5 @@ +all: + ant + +clean: + ant clean diff --git a/gi/posterior-regularisation/prjava/build.xml b/gi/posterior-regularisation/prjava/build.xml index 40199144..97569bef 100644 --- a/gi/posterior-regularisation/prjava/build.xml +++ b/gi/posterior-regularisation/prjava/build.xml @@ -32,8 +32,6 @@ - - diff --git a/gi/posterior-regularisation/prjava/lib/jopt-simple-3.2.jar b/gi/posterior-regularisation/prjava/lib/jopt-simple-3.2.jar new file mode 100644 index 00000000..56373621 Binary files /dev/null and b/gi/posterior-regularisation/prjava/lib/jopt-simple-3.2.jar differ 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