From db7216516604a6197414f281713a64fefc7221f9 Mon Sep 17 00:00:00 2001 From: desaicwtf Date: Wed, 21 Jul 2010 15:02:12 +0000 Subject: previously committed wrong version git-svn-id: https://ws10smt.googlecode.com/svn/trunk@355 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/posterior-regularisation/prjava/src/phrase/Corpus.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gi') diff --git a/gi/posterior-regularisation/prjava/src/phrase/Corpus.java b/gi/posterior-regularisation/prjava/src/phrase/Corpus.java index 21375baa..4b1939cd 100644 --- a/gi/posterior-regularisation/prjava/src/phrase/Corpus.java +++ b/gi/posterior-regularisation/prjava/src/phrase/Corpus.java @@ -222,7 +222,10 @@ public class Corpus String countString = parts[i + 1]; assert (countString.startsWith("C=")); - double count = Double.parseDouble(countString.substring(2).trim()); + + String []countToks=countString.split(" "); + + double count = Double.parseDouble(countToks[0].substring(2).trim()); TIntArrayList ctx = new TIntArrayList(); StringTokenizer ctxStrtok = new StringTokenizer(ctxString, " "); @@ -233,12 +236,12 @@ public class Corpus } int contextId = contextLexicon.insert(ctx); - String []countToks=countString.split(" "); + if(countToks.length<2){ edges.add(new Edge(phraseId, contextId, count)); } else{ - int tag=Integer.parseInt(countToks[1]); + int tag=Integer.parseInt(countToks[1].substring(2)); edges.add(new Edge(phraseId, contextId, count,tag)); } } -- cgit v1.2.3