From 3d0c691694ddcf00a5bfc347626d38625f057dee Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 3 May 2015 17:17:25 +0200 Subject: SCI: Handle pronouns in parser When parsing a sentence, its type 0x142 word (presumably the object) is now stored. Any pronouns (type 0x080) are then automatically replaced by this stored word. --- engines/sci/parser/vocabulary.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/sci/parser/vocabulary.h') diff --git a/engines/sci/parser/vocabulary.h b/engines/sci/parser/vocabulary.h index 09499946cb..f4adee6e55 100644 --- a/engines/sci/parser/vocabulary.h +++ b/engines/sci/parser/vocabulary.h @@ -232,6 +232,16 @@ public: */ int parseGNF(const ResultWordListList &words, bool verbose = false); + /** + * Find and store reference for future pronouns + */ + bool storePronounReference(); + + /** + * Replace pronouns by stored reference + */ + void replacePronouns(ResultWordListList &words); + /** * Constructs the Greibach Normal Form of the grammar supplied in 'branches'. * @param verbose Set to true for debugging. If true, the list is @@ -360,6 +370,8 @@ private: SynonymList _synonyms; /**< The list of synonyms */ Common::Array > _altInputs; + int _pronounReference; + public: // Accessed by said() ParseTreeNode _parserNodes[VOCAB_TREE_NODES]; /**< The parse tree */ -- cgit v1.2.3