Commit Graph

14012 Commits

Author SHA1 Message Date
Jeroen Vermeulen
a25193cc5d Fix a lot of lint, mostly trailing whitespace.
This is lint reported by the new lint-checking functionality in beautify.py.
(We can change to a different lint checker if we have a better one, but it
would probably still flag these same problems.)

Lint checking can help a lot, but only if we get the lint under control.
2015-05-17 20:04:04 +07:00
Jeroen Vermeulen
108da16374 Suppress CSS lint checking; accept longer lines.
The CSS style that Pocketlint expects is just too different from what we
have.  Don't check those files for now.

Also, a maximum line length of 300 still gives too many warnings, so I'm
regretfully dumping the default to 400 characters.  The traditional 80
characters are already longer than the measured optimum for human reading,
so I hope some day we can address this!
2015-05-17 20:03:27 +07:00
Jeroen Vermeulen
262edf2511 Fix more python lint. 2015-05-17 18:27:13 +07:00
Jeroen Vermeulen
07a8fe06aa Also support checking for lint.
Choose which action(s) you want for each run: --format and/or --lint.

Many different types of files are lint-checkable, but you need Pocketlint
installed (plus ideally, its plugins for the various languages).

Also, added option to control batching of the commands.
2015-05-17 18:25:06 +07:00
Jeroen Vermeulen
9bdcb5f7c1 Fix more Python lint.
This is about the last that isn't in contrib or generated files.  At this
point we can start doing regular lint checks, at least on the Python files,
without being completely inundated with warnings.
2015-05-16 18:03:54 +07:00
Jeroen Vermeulen
61162dd242 Fix more Python lint.
Most of the complaints fixed here were from Pocketlint, but many were also
from Syntastic the vim plugin.
2015-05-16 17:26:56 +07:00
Jeroen Vermeulen
c07ade8142 Merge branch 'python-lint' 2015-05-16 14:59:51 +07:00
Jeroen Vermeulen
0ffe79579e Fix some python lint.
I used mainly pocketlint, a very good Python linter, but also Syntastic,
a vim plugin.  Didn't get anywhere near fixing all of Syntastic's complaints
though.

Once I've cleaned up all (or at least most) of the Python lint, we can
start doing regular automated lint checks and keep the code clean.
2015-05-16 14:58:03 +07:00
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
Jeroen Vermeulen
f1ed14eb33 Move ignored path prefixes into config file.
The path prefixes listed in .beautify-ignore, in the project root, will not
be cleaned up.  C and C++ files everywhere else will be.

Also fixes bugs in the prefix-matching code, and makes the matching a little
bit more powerful: the prefix can now extend down into the directory tree.
2015-05-15 16:40:06 +07:00
Jeroen Vermeulen
d7599134b8 Remove the --any-astyle option.
The risk from flip-flopping on styles is too great: 2.04 formatting has
many changes from 2.01 formatting.

Also, fix a broken version check.
2015-05-15 15:24:54 +07:00
Marcin Junczys-Dowmunt
526aab441c Merge branch 'master' of github.com:moses-smt/mosesdecoder 2015-05-15 09:13:03 +02:00
Marcin Junczys-Dowmunt
7652ab9118 quick fix for out-of-bound alignment points 2015-05-15 09:12:51 +02:00
Jeroen Vermeulen
3e821b56dd Rewrite beautify script in Python.
The new version is much longer, but hopefully extensible, reusable, and
easy to read.  With a few more changes it will let us do three things:

1. Apply more checks and cleanups.
2. Clean up additional file types.
3. Use the same script for mgiza++, so we get a uniform code style.

The "more cleanups" could be more things like the removal of trailing
whitespace which we just added.  We may even want to run lint checkers of
some sort.

Additional file types could be e.g. Perl scripts, build configuration,
or documentation.

In order to make the script reusable we'll have to generalize the
skip_at_root list in list_c_like_files into something like a configuration
file.
2015-05-15 13:46:00 +07:00
Kenneth Heafield
630ffe9316 Revert "Try to fix moses_chart symlinking for Amittai Axelrod"
This reverts commit ed7ff35ff8.
2015-05-14 16:44:50 -05:00
Kenneth Heafield
ed7ff35ff8 Try to fix moses_chart symlinking for Amittai Axelrod 2015-05-13 17:21:10 -05:00
Barry Haddow
e61c905687 Merge branch 'master' of github.com:moses-smt/mosesdecoder 2015-05-13 12:13:09 +01:00
Barry Haddow
294dcbb7a1 format of output 2015-05-13 12:12:20 +01:00
Barry Haddow
e47e6c0200 dependency on hgdecode 2015-05-13 11:40:49 +01:00
Hieu Hoang
5173b9f617 beautify. Add sed for trailing spaces 2015-05-13 11:29:16 +01:00
Barry Haddow
89b364bbf0 move hg decoding test to reg tests 2015-05-13 11:21:50 +01:00
Jeroen Vermeulen
0859e9a844 Remove trailing whitespace from C++ files. 2015-05-13 17:05:43 +07:00
Barry Haddow
e34db401ee Refactoring of weight loading, making it easier to test hg rescoring. 2015-05-13 10:21:43 +01:00
Hieu Hoang
87e1f1351f tighten up OSM build. More debugging output, to stderr not stdout. lmplz uses outdir as temp directory 2015-05-13 12:29:56 +04:00
Hieu Hoang
0cd62488bf morfessor wrapper 2015-05-12 20:40:19 +04:00
Hieu Hoang
abfc0671a3 osm tweaks and morfessor wrapper 2015-05-12 20:19:39 +04:00
Hieu Hoang
a922245864 default to using lmplz for convenience and because SRILM uses tonnes of memory 2015-05-12 11:44:05 +04:00
Hieu Hoang
99a4813353 Merge branch 'master' of github.com:moses-smt/mosesdecoder 2015-05-12 10:41:05 +04:00
Hieu Hoang
03e507f354 default to using lmplz for convenience and because SRILM uses tonnes of memory 2015-05-12 10:40:52 +04: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
adf717101b Merge branch 'master' of https://github.com/moses-smt/mosesdecoder 2015-05-12 02:31:39 +01: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
Hieu Hoang
a6b441dab9 codelite 2015-05-11 18:51:34 +04:00
Hieu Hoang
8bb18b9ff0 add no-splitter-training argument. Splitter to be used by mada 2015-05-11 15:26:50 +04: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
Jeroen Vermeulen
91e699f90d Modernize symal source code.
Part of symal was still written in K&R C (though with an anachronistic C99
version comment!).  Updating it to ANSI C, adding const in many places for
clarity.  Reordering functions to eliminate forward declarations.

Moving definition of Cmd_T into cmd.c, since it's local to that file.
Adding some wrappers to reduce the casts around Cmd_T.p.  Narrowing the
scope of some variables.

Also updating the C++: use anonymous namespace for "static" definitions,
use enums and constants instead of preprocessor macros, use false/true as
boolean constants, throw exceptions instead of print-and-exit, avoid use of
"final" as an identifier since it's now a reserved word.
2015-05-10 15:28:28 +07:00
Barry Haddow
85c1af4d72 Merge branch 'master' of github.com:moses-smt/mosesdecoder 2015-05-08 09:16:55 +01:00
Barry Haddow
f403f5e478 mmsapt doesn't require feature weights on first tuning iteration 2015-05-08 09:16:51 +01:00
XapaJIaMnu
8e6eb067bc Add profiling option to the testsuite. Untested. 2015-05-05 17:36:19 +01:00
Hieu Hoang
2acb590394 output bleu for multi-bleu hack 2015-05-05 17:54:35 +04:00
Hieu Hoang
d006c6ef8c don't output remaining args twice 2015-05-05 12:15:08 +04:00
Hieu Hoang
5fefb0da47 Merge branch 'master' of github.com:moses-smt/mosesdecoder 2015-05-05 12:02:13 +04:00
Hieu Hoang
8f272e04a9 output debugging messages to stderr, not stdout 2015-05-05 12:01:21 +04:00