Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'moses/TranslationModel/ProbingPT/probing_hash_utils.hh')
-rw-r--r--moses/TranslationModel/ProbingPT/probing_hash_utils.hh38
1 files changed, 28 insertions, 10 deletions
diff --git a/moses/TranslationModel/ProbingPT/probing_hash_utils.hh b/moses/TranslationModel/ProbingPT/probing_hash_utils.hh
index de96e87a0..dcf0dbe25 100644
--- a/moses/TranslationModel/ProbingPT/probing_hash_utils.hh
+++ b/moses/TranslationModel/ProbingPT/probing_hash_utils.hh
@@ -7,31 +7,49 @@
#include <fcntl.h>
#include <fstream>
+namespace Moses
+{
+
+#define API_VERSION 15
//Hash table entry
-struct Entry {
- uint64_t key;
+struct Entry
+{
typedef uint64_t Key;
- unsigned int bytes_toread;
+ Key key;
- uint64_t GetKey() const {
+ Key GetKey() const
+ {
return key;
}
- void SetKey(uint64_t to) {
+ void SetKey(Key to)
+ {
key = to;
}
- uint64_t GetValue() const {
- return value;
- }
-
uint64_t value;
};
+#define NONE std::numeric_limits<uint64_t>::max()
+
//Define table
typedef util::ProbingHashTable<Entry, boost::hash<uint64_t> > Table;
-void serialize_table(char *mem, size_t size, const char * filename);
+void serialize_table(char *mem, size_t size, const std::string &filename);
char * readTable(const char * filename, size_t size);
+
+uint64_t getKey(const uint64_t source_phrase[], size_t size);
+
+struct TargetPhraseInfo
+{
+ uint32_t alignTerm;
+ uint32_t alignNonTerm;
+ uint16_t numWords;
+ uint16_t propLength;
+ uint16_t filler;
+};
+
+}
+