mosesdecoder/moses/TranslationModel/RuleTable
Jeroen Vermeulen 38d790cac0 Add cross-platform randomizer module.
The code uses two mechanisms for generating random numbers: srand()/rand(),
which is not thread-safe, and srandom()/random(), which is POSIX-specific.

Here I add a util/random.cc module that centralizes these calls, and unifies
some common usage patterns.  If the implementation is not good enough, we can
now change it in a single place.

To keep things simple, this uses the portable srand()/rand() but protects them
with a lock to avoid concurrency problems.

The hard part was to keep the regression tests passing: they rely on fixed
sequences of random numbers, so a small code change could break them very
thoroughly.  Util::rand(), for wide types like size_t, calls std::rand() not
once but twice.  This behaviour was generalized into utils::wide_rand() and
friends.
2015-04-23 23:46:04 +07:00
..
Loader.h beautify 2013-05-29 18:16:15 +01:00
LoaderCompact.cpp beautify 2015-01-14 11:07:42 +00:00
LoaderCompact.h beautify 2013-05-29 18:16:15 +01:00
LoaderFactory.cpp delete UserMessage. Too difficult to police 2015-01-07 10:01:10 +04:00
LoaderFactory.h beautify 2013-05-29 18:16:15 +01:00
LoaderHiero.cpp beautify 2013-05-29 18:16:15 +01:00
LoaderHiero.h beautify 2013-05-29 18:16:15 +01:00
LoaderStandard.cpp Modernize "C" includes in moses. 2015-03-28 20:09:03 +07:00
LoaderStandard.h beautify 2013-05-29 18:16:15 +01:00
PhraseDictionaryALSuffixArray.cpp beautify 2015-01-14 11:07:42 +00:00
PhraseDictionaryALSuffixArray.h calculate m_featuresToApply in Load() for PhraseDictionary. Since every phrase dictionary now has to implement it, make Load() for PhraseDictionary abstract 2013-06-14 18:34:47 +01:00
PhraseDictionaryFuzzyMatch.cpp Add cross-platform randomizer module. 2015-04-23 23:46:04 +07:00
PhraseDictionaryFuzzyMatch.h moses_chart: more efficient scope-3 parsing if sentence length < max-chart-span 2014-03-14 08:49:09 +00:00
PhraseDictionaryOnDisk.cpp use astyle 2.01. It's on Edinburgh server and doesn't screw up enum 2015-01-14 19:21:11 +00:00
PhraseDictionaryOnDisk.h delete PhraseTableImplementation. Old enum 2014-07-18 20:36:53 +01:00
Trie.cpp calculate m_featuresToApply in Load() for PhraseDictionary. Since every phrase dictionary now has to implement it, make Load() for PhraseDictionary abstract 2013-06-14 18:34:47 +01:00
Trie.h remove description argument from feature function constructor. Redundant 2013-10-29 18:20:55 +00:00
UTrie.cpp moses_chart: more efficient scope-3 parsing if sentence length < max-chart-span 2014-03-14 08:49:09 +00:00
UTrie.h moses_chart: more efficient scope-3 parsing if sentence length < max-chart-span 2014-03-14 08:49:09 +00:00
UTrieNode.cpp beautify 2013-05-29 18:16:15 +01:00
UTrieNode.h beautify 2013-05-29 18:16:15 +01:00