From d125974b3980ac8b5831dd0ad80073caf4492a4a Mon Sep 17 00:00:00 2001 From: "trevor.cohn" Date: Tue, 20 Jul 2010 19:35:20 +0000 Subject: Allow fractional counts. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@337 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/posterior-regularisation/prjava/src/phrase/Corpus.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gi/posterior-regularisation/prjava/src/phrase/Corpus.java') diff --git a/gi/posterior-regularisation/prjava/src/phrase/Corpus.java b/gi/posterior-regularisation/prjava/src/phrase/Corpus.java index ad092cc6..6936b28b 100644 --- a/gi/posterior-regularisation/prjava/src/phrase/Corpus.java +++ b/gi/posterior-regularisation/prjava/src/phrase/Corpus.java @@ -28,7 +28,7 @@ public class Corpus public class Edge { - Edge(int phraseId, int contextId, int count) + Edge(int phraseId, int contextId, double count) { this.phraseId = phraseId; this.contextId = contextId; @@ -58,7 +58,7 @@ public class Corpus { return Corpus.this.getContextString(contextId, insertPhraseSentinel); } - public int getCount() + public double getCount() { return count; } @@ -84,7 +84,7 @@ public class Corpus private int phraseId; private int contextId; - private int count; + private double count; } List getEdges() @@ -207,7 +207,7 @@ public class Corpus String countString = parts[i + 1]; assert (countString.startsWith("C=")); - int count = Integer.parseInt(countString.substring(2).trim()); + double count = Double.parseDouble(countString.substring(2).trim()); TIntArrayList ctx = new TIntArrayList(); StringTokenizer ctxStrtok = new StringTokenizer(ctxString, " "); -- cgit v1.2.3