summaryrefslogtreecommitdiff
path: root/gi
diff options
context:
space:
mode:
authordesaicwtf <desaicwtf@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-21 15:02:12 +0000
committerdesaicwtf <desaicwtf@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-21 15:02:12 +0000
commit9d5834f8b3b20c547d146703351cfc41f5bb37dd (patch)
tree369f5a2ec743c20c4faf715e3016e28550210dbf /gi
parentc47acf77b4f326bde93d9e7bc3858f9950787bf7 (diff)
previously committed wrong version
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@355 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi')
-rw-r--r--gi/posterior-regularisation/prjava/src/phrase/Corpus.java9
1 files changed, 6 insertions, 3 deletions
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));
}
}