From ad418214fe3b3fcd33d81225eb3d3fb08b67f88a Mon Sep 17 00:00:00 2001 From: desaicwtf Date: Mon, 28 Jun 2010 23:14:21 +0000 Subject: add draft version of POS induction with HMM and L1 Linf constraints git-svn-id: https://ws10smt.googlecode.com/svn/trunk@47 ec762483-ff6d-05da-a07a-a48fb63a330f --- .../prjava/src/io/FileUtil.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 gi/posterior-regularisation/prjava/src/io/FileUtil.java (limited to 'gi/posterior-regularisation/prjava/src/io/FileUtil.java') diff --git a/gi/posterior-regularisation/prjava/src/io/FileUtil.java b/gi/posterior-regularisation/prjava/src/io/FileUtil.java new file mode 100644 index 00000000..bfa58213 --- /dev/null +++ b/gi/posterior-regularisation/prjava/src/io/FileUtil.java @@ -0,0 +1,37 @@ +package io; +import java.util.*; +import java.io.*; +public class FileUtil { + public static Scanner openInFile(String filename){ + Scanner localsc=null; + try + { + localsc=new Scanner (new FileInputStream(filename)); + + }catch(IOException ioe){ + System.out.println(ioe.getMessage()); + } + return localsc; + } + public static PrintStream openOutFile(String filename){ + PrintStream localps=null; + try + { + localps=new PrintStream (new FileOutputStream(filename)); + + }catch(IOException ioe){ + System.out.println(ioe.getMessage()); + } + return localps; + } + public static FileInputStream openInputStream(String infilename){ + FileInputStream fis=null; + try { + fis =(new FileInputStream(infilename)); + + } catch (IOException ioe) { + System.out.println(ioe.getMessage()); + } + return fis; + } +} -- cgit v1.2.3