From dc6930c00b4b276883280cff1ed6dcd9ddef03c7 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Tue, 8 Dec 2009 21:38:55 -0500 Subject: LICENSE fixes, full support of lattice decoding --- src/grammar.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/grammar.h') diff --git a/src/grammar.h b/src/grammar.h index 4a03c505..3471e3f1 100644 --- a/src/grammar.h +++ b/src/grammar.h @@ -28,7 +28,7 @@ struct Grammar { virtual ~Grammar(); virtual const GrammarIter* GetRoot() const = 0; - virtual bool HasRuleForSpan(int i, int j) const; + virtual bool HasRuleForSpan(int i, int j, int distance) const; // cat is the category to be rewritten inline const std::vector& GetAllUnaryRules() const { @@ -59,7 +59,7 @@ struct TextGrammar : public Grammar { virtual const GrammarIter* GetRoot() const; void AddRule(const TRulePtr& rule); void ReadFromFile(const std::string& filename); - virtual bool HasRuleForSpan(int i, int j) const; + virtual bool HasRuleForSpan(int i, int j, int distance) const; const std::vector& GetUnaryRules(const WordID& cat) const; private: int max_span_; @@ -70,12 +70,12 @@ struct GlueGrammar : public TextGrammar { // read glue grammar from file explicit GlueGrammar(const std::string& file); GlueGrammar(const std::string& goal_nt, const std::string& default_nt); // "S", "X" - virtual bool HasRuleForSpan(int i, int j) const; + virtual bool HasRuleForSpan(int i, int j, int distance) const; }; struct PassThroughGrammar : public TextGrammar { PassThroughGrammar(const Lattice& input, const std::string& cat); - virtual bool HasRuleForSpan(int i, int j) const; + virtual bool HasRuleForSpan(int i, int j, int distance) const; private: std::vector > has_rule_; // index by [i][j] }; -- cgit v1.2.3