Can we move all or parts of moses/Util to util/, and
from the Moses namespace to the util namespace?
There's quite some common functionality in it that is not only relevant
to the decoder, but also to phrase extraction and possibly other parts
of the toolkit.
This replaces a segfault when a file can't be found with an exception.
Not as helpful as it could be yet, but certainly better than just
crashing.
Also, make InputFileStream constructor from path "explicit" to avoid
mistakes.
Final commit in this round of refactoring (which started with commit
2f735998...). The main changes are:
- a general storage mechanism for attribute/value pairs in XML-style
tree / lattice input. E.g. the "pcfg-score" and "semantic-role"
attributes in:
<tree label="PRP" pcfg-score="1.0" semantic-role="AGENT"> I </tree>
- consolidation of the various near-duplicate Tree / XmlTreeParser classes
that have accumulated over the years (my fault)
- miscellaneous de-crufting
This is the first step in a small-scale refactoring effort that will touch a
lot of the syntax-related code in moses/phrase-extract. The end goals are:
- a storage mechanism for general attribute/value pairs in XML-style
tree / lattice input. E.g. the "pcfg-score" and "semantic-role"
attributes in:
<tree label="PRP" pcfg-score="1.0" semantic-role="AGENT"> I </tree>
- consolidation of the various near-duplicate Tree / XmlTreeParser classes
that have accumulated over the years (my fault)
- general de-crufting
This is a common convention: when a program gets a dash as the path of a
file that it should write, it writes to standard output instead.
Enhances portability to systems that don't have /dev/stdout.
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.