Commit Graph

4594 Commits

Author SHA1 Message Date
Hieu Hoang
39139e7a64 beautify. 2015-05-15 18:09:38 +01:00
Ulrich Germann
8afaf7fb2f Bug fix. 2015-05-15 17:37:05 +01:00
Marcin Junczys-Dowmunt
7652ab9118 quick fix for out-of-bound alignment points 2015-05-15 09:12:51 +02:00
Hieu Hoang
5173b9f617 beautify. Add sed for trailing spaces 2015-05-13 11:29:16 +01:00
Jeroen Vermeulen
0859e9a844 Remove trailing whitespace from C++ files. 2015-05-13 17:05:43 +07:00
Jeroen Vermeulen
1364a7d599 Fix typo in mmap call.
The case where !m_fixed passed m_map_size to mmap(), but the "else"
clause passed map_size.  In replacing mmap() with the portable wrapper,
I accidentally changed that to be m_map_size as well.

Besides fixing that, I'm changing the name of the variable to be more
clearly distinguishable from m_map_size.
2015-05-12 09:58:47 +07:00
Ulrich Germann
d122605c0d Code reorganization with respect to hypergraph output. 2015-05-12 02:28:58 +01:00
Ulrich Germann
f087fce65e Reformatting. 2015-05-11 23:13:13 +01:00
Ulrich Germann
25ec936adf Merge branch 'master' of https://github.com/moses-smt/mosesdecoder 2015-05-11 00:39:45 +01:00
Ulrich Germann
7da7ce52da Added context buffering in IOWrapper for context-sensitive decoding.
Unfortunately, this seems to slow things down quite a bit.
2015-05-11 00:34:24 +01:00
Ulrich Germann
db5ccff364 Tweaks to logging for biased sampling. 2015-05-11 00:33:21 +01:00
Ulrich Germann
1778238d73 Logging of latency of bias lookup via server. 2015-05-11 00:32:20 +01:00
Ulrich Germann
8a174beb44 Additional check for document map if document bias is requested. 2015-05-11 00:30:32 +01:00
Hieu Hoang
4f02f19ab4 beautify 2015-05-10 10:19:26 +01:00
Nicola Bertoldi
6085a60494 bug fix 2015-05-04 09:51:12 +02:00
Nicola Bertoldi
90a982e579 merge remote into local 2015-05-04 09:42:44 +02:00
Nicola Bertoldi
c4f04670c2 made ProbingPT constructor compliant with PhraseDictionary signature 2015-05-04 09:25:50 +02:00
Nicola Bertoldi
85a4e48df4 made use of boost::shared_mutex dependent from WITH_THREADS 2015-05-04 09:24:36 +02:00
Ulrich Germann
2b671e67dd Merge branch 'master' of https://github.com/moses-smt/mosesdecoder 2015-05-03 15:09:45 +01:00
Ulrich Germann
6d40c6e209 Bug fix wrt. lexical reordering of OOV words in combination with Mmsapt. 2015-05-03 15:09:26 +01:00
Hieu Hoang
402b958d90 some astyle version don't like prefixed commas 2015-05-03 10:03:38 +04:00
Hieu Hoang
cc8c6b7b10 beautify 2015-05-02 11:45:24 +01:00
Matthias Huck
34d1d3a904 sentence-bleu-nbest 2015-04-30 19:44:29 +01:00
Jeroen Vermeulen
eca5824100 Remove trailing whitespace in C++ files. 2015-04-30 12:05:11 +07:00
Ulrich Germann
324b1a9b56 Merge branch 'master' of https://github.com/moses-smt/mosesdecoder 2015-04-29 20:20:54 +01:00
Ulrich Germann
e4f5c69109 One step closer to eliminating the requirement to provide num-features=... in the config file.
Some FF (Mmsapt, LexicalReordering, Many single-value FF) provide this number during "registration";
when missing, a default weight vector of uniform 1.0 is automatically generated. This eliminates the
need for the user to figure out what the exact number of features is for each FF, which can get complicated,
e.g. in the case of Mmsapt/PhraseDictionaryBitextSampling.
2015-04-29 20:16:52 +01:00
Ulrich Germann
c76f1c338d Uninitialized variable. 2015-04-29 20:16:43 +01:00
Ulrich Germann
d99479d5a3 Bug fix. 2015-04-29 20:11:34 +01:00
Ulrich Germann
8b2e5ea0be No try { ... } catch { ... } in debug mode. 2015-04-29 20:07:03 +01:00
Jeroen Vermeulen
616b589da3 Fix a bunch of compiler warnings.
Warnings are useful, but only if there are few!
2015-04-29 21:18:51 +07:00
Hieu Hoang
0ee4feecb5 add extra parser argument to ChartCellCollection to support FF::EvaluateGivenAllOtherTransOpts() 2015-04-27 22:41:47 +04:00
Ulrich Germann
315610c02a Merge branch 'master' of https://github.com/moses-smt/mosesdecoder 2015-04-27 16:39:40 +01:00
Ulrich Germann
ba6e17ce26 Code reorganization. 2015-04-27 16:31:22 +01:00
Ulrich Germann
37bb1de9ed Unused variable. 2015-04-27 16:30:59 +01:00
Ulrich Germann
fbf8b1f8b8 Code design debizarrification: Indexes of feature functions into the dense vector of all feature
values are now stored on the feature function instead of in a global map that is a static
member of ScoreComponentCollection.
2015-04-26 16:46:36 +01:00
Ulrich Germann
e63561ae7f Unused variable. 2015-04-26 15:41:32 +01:00
Hieu Hoang
41529227b2 boost unique lock 2015-04-26 18:11:11 +04:00
Ulrich Germann
bafe60c3a1 Make sure things work when curl-based biasing is disabled. 2015-04-26 03:14:40 +01:00
Ulrich Germann
0d72cdd72c Merge branch 'master' of https://github.com/moses-smt/mosesdecoder into mmt-dev
Conflicts:
	moses/Syntax/F2S/Manager-inl.h
	moses/TranslationModel/UG/mmsapt.cpp
2015-04-26 02:12:16 +01:00
Matthias Huck
55a4789a8b cleanup 2015-04-23 18:38:01 +01:00
Matthias Huck
3920e22c98 Merge branch 'master' of https://github.com/moses-smt/mosesdecoder 2015-04-23 18:25:13 +01:00
Jeroen Vermeulen
8ac91c8d97 Fix unqualified call to rand_excl().
The call needed to be made explicitly to util::rand_excl().  Sorry.
2015-04-24 00:22:25 +07:00
Matthias Huck
bbcc8bf23b Merge branch 'master' of https://github.com/moses-smt/mosesdecoder 2015-04-23 18:14:40 +01:00
Matthias Huck
f24f31f965 n-best list creation in phrase-based decoding: improved efficiency with sparse features 2015-04-23 18:13:02 +01:00
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
Matthias Huck
7457099f51 SparseReordering: option to use pre-tuned feature weights internally 2015-04-23 17:25:02 +01:00
Jeroen Vermeulen
02d1d9a4af Don't work around missing popen() in MinGW.
Windows does not have popen()/pclose(), so FileHandler.cpp #define's them to
_popen()/_pclose().  But MinGW has similar macros built into <cstdio>, leading
to warnings.  So skip the workaround on MinGW.
2015-04-22 11:24:32 +07:00
Jeroen Vermeulen
32722ab5b1 Support tokenize(const std::string &) as well.
Convenience wrapper: the actual function takes a const char[], but many of
the call sites want to pass a string and have to call its c_str() first.
2015-04-22 10:35:18 +07:00
Jeroen Vermeulen
b2d821a141 Unify tokenize() into util, and unit-test it.
The duplicate definition works fine in environments where the inline
definition becomes a weak symbol in the object file, but if it gets
generated as a regular definition, the duplicate definition causes link
problems.

In most call sites the return value could easily be made const, which
gives both the reader and the compiler a bit more certainty about the code's
intentions.  In theory this may help performance, but it's mainly for clarity.

The comments are based on reverse-engineering, and the unit tests are based
on the comments.  It's possible that some of what's in there is not essential,
in which case, don't feel bad about changing it!

I left a third identical definition in place, though I updated it with my
changes to avoid creeping divergence, and noted the duplication in a comment.
It would be nice to get rid of this definition as well, but it'd introduce
headers from the main Moses tree into biconcor, which may be against policy.
2015-04-22 09:59:05 +07:00
Ulrich Germann
7603ec95f7 Recognize lexicalized reordering scores on TranslationOption instances provided e.g. by phrase tables. 2015-04-21 17:54:40 +01:00