Fix json output for right and left neighbours
Change-Id: I001aaffc4f0bcd9c8a2e95ffeaa7985b8e9d88c6
diff --git a/collocatordb.cc b/collocatordb.cc
index 9a23173..cdb41e1 100644
--- a/collocatordb.cc
+++ b/collocatordb.cc
@@ -49,8 +49,8 @@
double llr;
double lfmd;
double md;
- double left_raw;
- double right_raw;
+ uint64_t left_raw;
+ uint64_t right_raw;
double left_pmi;
double right_pmi;
double dice;
@@ -599,13 +599,18 @@
}
}
- *result = {w2, f2, sum,
- pmi, pmi / (-log2(o/total/true_window_size)),
- llr, lfmd, md,
+ *result = {w2,
+ f2,
+ sum,
+ pmi,
+ pmi / (-log2(o/total/true_window_size)),
+ llr,
+ lfmd,
+ md,
+ sumWindow[WINDOW_SIZE],
+ sumWindow[WINDOW_SIZE-1],
ca_pmi(f1, f2, sumWindow[WINDOW_SIZE], total, 1),
ca_pmi(f1, f2, sumWindow[WINDOW_SIZE-1], total, 1),
- (double)sumWindow[WINDOW_SIZE],
- (double)sumWindow[WINDOW_SIZE-1],
ca_dice(f1, f2, sum, total, true_window_size),
ld,
bestAF,
@@ -784,7 +789,7 @@
"}";
}
s << "]}\n";
- std::cout << s.str();
+ // std::cout << s.str();
return s.str();
}
diff --git a/collocatordb.h b/collocatordb.h
index f249791..a033dcb 100644
--- a/collocatordb.h
+++ b/collocatordb.h
@@ -32,6 +32,27 @@
int window;
int af_window;
};
+namespace rocksdb {
+ class Collocator {
+ public:
+ uint32_t w2;
+ uint64_t f2;
+ uint64_t raw;
+ double pmi;
+ double npmi;
+ double llr;
+ double lfmd;
+ double md;
+ uint64_t left_raw;
+ uint64_t right_raw;
+ double left_pmi;
+ double right_pmi;
+ double dice;
+ double logdice;
+ double ldaf;
+ int window;
+ int af_window;
+ };
class CollocatorIterator : public Iterator {
public: