aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/parser/vocabulary.h
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2015-05-03 17:17:25 +0200
committerWillem Jan Palenstijn2015-05-03 17:21:07 +0200
commit3d0c691694ddcf00a5bfc347626d38625f057dee (patch)
treeddc71b59abc595f7911de10e3209d64e703c92d0 /engines/sci/parser/vocabulary.h
parent30b5497e24965849469be0ff5c2620eef5ebfa0e (diff)
downloadscummvm-rg350-3d0c691694ddcf00a5bfc347626d38625f057dee.tar.gz
scummvm-rg350-3d0c691694ddcf00a5bfc347626d38625f057dee.tar.bz2
scummvm-rg350-3d0c691694ddcf00a5bfc347626d38625f057dee.zip
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.
Diffstat (limited to 'engines/sci/parser/vocabulary.h')
-rw-r--r--engines/sci/parser/vocabulary.h12
1 files changed, 12 insertions, 0 deletions
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
@@ -233,6 +233,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
* freed before the function ends
@@ -360,6 +370,8 @@ private:
SynonymList _synonyms; /**< The list of synonyms */
Common::Array<Common::List<AltInput> > _altInputs;
+ int _pronounReference;
+
public:
// Accessed by said()
ParseTreeNode _parserNodes[VOCAB_TREE_NODES]; /**< The parse tree */