diff options
author | MosesAdmin <moses-support-owner@mit.edu> | 2017-02-01 03:59:30 +0300 |
---|---|---|
committer | MosesAdmin <moses-support-owner@mit.edu> | 2017-02-01 03:59:30 +0300 |
commit | 657deaef5c9c66d862d5aeb9f2d5e2852c2680d9 (patch) | |
tree | 72ace40e2fb5ef09a46d592bb97f3b1146861ca7 /moses2/TranslationModel | |
parent | 11e422d43b7d2c87933e4d6f2f2001da58dc1fe8 (diff) |
daily automatic beautifier
Diffstat (limited to 'moses2/TranslationModel')
-rw-r--r-- | moses2/TranslationModel/ProbingPT/line_splitter.hh | 6 | ||||
-rw-r--r-- | moses2/TranslationModel/ProbingPT/probing_hash_utils.hh | 12 | ||||
-rw-r--r-- | moses2/TranslationModel/ProbingPT/querying.hh | 13 | ||||
-rw-r--r-- | moses2/TranslationModel/ProbingPT/storing.hh | 23 | ||||
-rw-r--r-- | moses2/TranslationModel/ProbingPT/vocabid.hh | 4 |
5 files changed, 25 insertions, 33 deletions
diff --git a/moses2/TranslationModel/ProbingPT/line_splitter.hh b/moses2/TranslationModel/ProbingPT/line_splitter.hh index 3b086b44a..0b91fed09 100644 --- a/moses2/TranslationModel/ProbingPT/line_splitter.hh +++ b/moses2/TranslationModel/ProbingPT/line_splitter.hh @@ -13,8 +13,7 @@ namespace Moses2 { //Struct for holding processed line -struct line_text -{ +struct line_text { StringPiece source_phrase; StringPiece target_phrase; StringPiece prob; @@ -26,8 +25,7 @@ struct line_text }; //Struct for holding processed line -struct target_text -{ +struct target_text { std::vector<unsigned int> target_phrase; std::vector<float> prob; std::vector<size_t> word_align_term; diff --git a/moses2/TranslationModel/ProbingPT/probing_hash_utils.hh b/moses2/TranslationModel/ProbingPT/probing_hash_utils.hh index 368147807..7e275510a 100644 --- a/moses2/TranslationModel/ProbingPT/probing_hash_utils.hh +++ b/moses2/TranslationModel/ProbingPT/probing_hash_utils.hh @@ -13,18 +13,15 @@ namespace Moses2 #define API_VERSION 15 //Hash table entry -struct Entry -{ +struct Entry { typedef uint64_t Key; Key key; - Key GetKey() const - { + Key GetKey() const { return key; } - void SetKey(Key to) - { + void SetKey(Key to) { key = to; } @@ -42,8 +39,7 @@ char * readTable(const char * filename, util::LoadMethod load_method, util::scop uint64_t getKey(const uint64_t source_phrase[], size_t size); -struct TargetPhraseInfo -{ +struct TargetPhraseInfo { uint32_t alignTerm; uint32_t alignNonTerm; uint16_t numWords; diff --git a/moses2/TranslationModel/ProbingPT/querying.hh b/moses2/TranslationModel/ProbingPT/querying.hh index dcdd2a75a..4cb3228f2 100644 --- a/moses2/TranslationModel/ProbingPT/querying.hh +++ b/moses2/TranslationModel/ProbingPT/querying.hh @@ -50,17 +50,18 @@ public: std::pair<bool, uint64_t> query(uint64_t key); - const std::map<uint64_t, std::string> &getSourceVocab() const - { return source_vocabids; } + const std::map<uint64_t, std::string> &getSourceVocab() const { + return source_vocabids; + } - const std::vector<Alignments> &getAlignments() const - { return alignColl; } + const std::vector<Alignments> &getAlignments() const { + return alignColl; + } uint64_t getKey(uint64_t source_phrase[], size_t size) const; template<typename T> - inline bool Get(const boost::unordered_map<std::string, std::string> &keyValue, const std::string &sought, T &found) const - { + inline bool Get(const boost::unordered_map<std::string, std::string> &keyValue, const std::string &sought, T &found) const { boost::unordered_map<std::string, std::string>::const_iterator iter = keyValue.find(sought); if (iter == keyValue.end()) { return false; diff --git a/moses2/TranslationModel/ProbingPT/storing.hh b/moses2/TranslationModel/ProbingPT/storing.hh index 10d7050d3..a6f8dd143 100644 --- a/moses2/TranslationModel/ProbingPT/storing.hh +++ b/moses2/TranslationModel/ProbingPT/storing.hh @@ -32,7 +32,7 @@ public: bool done; Node() - :done(false) + :done(false) {} void Add(Table &table, const SourcePhrase &sourcePhrase, size_t pos = 0); @@ -41,8 +41,8 @@ public: void createProbingPT(const std::string &phrasetable_path, - const std::string &basepath, int num_scores, int num_lex_scores, - bool log_prob, int max_cache_size, bool scfg); + const std::string &basepath, int num_scores, int num_lex_scores, + bool log_prob, int max_cache_size, bool scfg); uint64_t getKey(const std::vector<uint64_t> &source_phrase); std::vector<uint64_t> CreatePrefix(const std::vector<uint64_t> &vocabid_source, size_t endPos); @@ -66,14 +66,12 @@ public: uint64_t sourceKey; float count; CacheItem(const std::string &vSource, uint64_t vSourceKey, float vCount) - :source(vSource) - ,sourceKey(vSourceKey) - ,count(vCount) - { + :source(vSource) + ,sourceKey(vSourceKey) + ,count(vCount) { } - bool operator<(const CacheItem &other) const - { + bool operator<(const CacheItem &other) const { return count > other.count; } }; @@ -81,15 +79,14 @@ public: class CacheItemOrderer { public: - bool operator()(const CacheItem* a, const CacheItem* b) const - { + bool operator()(const CacheItem* a, const CacheItem* b) const { return (*a) < (*b); } }; void serialize_cache( - std::priority_queue<CacheItem*, std::vector<CacheItem*>, CacheItemOrderer> &cache, - const std::string &path, float totalSourceCount); + std::priority_queue<CacheItem*, std::vector<CacheItem*>, CacheItemOrderer> &cache, + const std::string &path, float totalSourceCount); } diff --git a/moses2/TranslationModel/ProbingPT/vocabid.hh b/moses2/TranslationModel/ProbingPT/vocabid.hh index 55d99d453..9d37bd1b5 100644 --- a/moses2/TranslationModel/ProbingPT/vocabid.hh +++ b/moses2/TranslationModel/ProbingPT/vocabid.hh @@ -19,10 +19,10 @@ template<typename VOCABID> class StoreVocab; void add_to_map(StoreVocab<uint64_t> &sourceVocab, - const StringPiece &textin); + const StringPiece &textin); void serialize_map(const std::map<uint64_t, std::string> &karta, - const std::string &filename); + const std::string &filename); void read_map(std::map<uint64_t, std::string> &karta, const char* filename); |