diff options
| author | Patrick Simianer <patrick@lilt.com> | 2026-02-26 19:31:35 +0100 |
|---|---|---|
| committer | Patrick Simianer <patrick@lilt.com> | 2026-02-26 19:31:35 +0100 |
| commit | a1c5862a46b524d3e11a87c5a732c0c257aefe20 (patch) | |
| tree | db49b2e5f7bbb580217996810f9c26dcc59d2d58 /src/hypergraph.hh | |
| parent | 44f225d0642d2ecf13f533f68b9ae12d849809ea (diff) | |
Fix C++ ow binary to produce translations
- Node::mark and Node::score uninitialized, causing segfaults in
topological_sort — add default initializers (0, 0.0)
- odenwald.cc called incomplete sv_path() + exit(1) instead of
viterbi_path()
- viterbi_path: add reset() before topological_sort, initialize
best_edge to nullptr
- derive: off-by-one in NT order indexing — start j at 1 and
use order[j]-1 (1-indexed alignment map)
- read: ifs.readsome() returns 0 on macOS — use ifs.read() +
ifs.gcount()
- manual() signature: add missing Vocabulary parameter
- Remove gperftools/tcmalloc dependency from Makefile
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/hypergraph.hh')
| -rw-r--r-- | src/hypergraph.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hypergraph.hh b/src/hypergraph.hh index 7a268c3..d782c9e 100644 --- a/src/hypergraph.hh +++ b/src/hypergraph.hh @@ -48,10 +48,10 @@ struct Node { string symbol; short left; short right; - score_t score; + score_t score = 0.0; vector<Edge*> incoming; vector<Edge*> outgoing; - unsigned int mark; + unsigned int mark = 0; inline bool is_marked() { return mark >= incoming.size(); }; friend ostream& operator<<(ostream& os, const Node& n); @@ -98,7 +98,7 @@ void write(Hypergraph& hg, vector<G::Rule*>& rules, const string& fn); // FIXME void -manual(Hypergraph& hg, vector<G::Rule*>& rules); +manual(Hypergraph& hg, vector<G::Rule*>& rules, G::Vocabulary& vocab); } // namespace |
