add get_version function
Change-Id: I7f294d3a0ce1acb961c49a8a9bee0f3e8e2824eb
diff --git a/src/collocatordb.cc b/src/collocatordb.cc
index 28035f6..691f820 100644
--- a/src/collocatordb.cc
+++ b/src/collocatordb.cc
@@ -18,6 +18,7 @@
#include <rocksdb/slice_transform.h>
#include "merge_operators.h"
#include "export.h"
+#include "config.h"
#define WINDOW_SIZE 5
#define FREQUENCY_THRESHOLD 5
@@ -895,6 +896,10 @@
return strdup(db->collocators2json(w1, db->get_collocation_scores(w1, w2)).c_str());
}
+ DLL_EXPORT const char *get_version() {
+ return PROJECT_VERSION;
+ }
+
#ifdef __clang__
#pragma clang diagnostic push
#endif
diff --git a/src/collocatordb.h b/src/collocatordb.h
index 7b9b3f5..af97419 100644
--- a/src/collocatordb.h
+++ b/src/collocatordb.h
@@ -118,4 +118,4 @@
extern char *get_collocation_scores_as_json(COLLOCATORDB *db, uint32_t w1, uint32_t w2);
extern char *get_word(COLLOCATORDB *db, uint32_t w1);
extern void read_vocab(COLLOCATORDB *db, char *fname);
-
+extern char *get_version();