summaryrefslogtreecommitdiff
path: root/gi/posterior-regularisation/prjava
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
commitdb7216516604a6197414f281713a64fefc7221f9 (patch)
treeaf1dae1b87eaf223be9dd57ae685539e42ddd1b8 /gi/posterior-regularisation/prjava
parent0c901842ddb907fd45d29bdece5b48d42a599616 (diff)
previously committed wrong version
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@355 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/posterior-regularisation/prjava')
-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));
}
}