aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/vocabulary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/vocabulary.cpp')
-rw-r--r--engines/sci/vocabulary.cpp96
1 files changed, 0 insertions, 96 deletions
diff --git a/engines/sci/vocabulary.cpp b/engines/sci/vocabulary.cpp
index 7df8d7f5cc..b830b57c89 100644
--- a/engines/sci/vocabulary.cpp
+++ b/engines/sci/vocabulary.cpp
@@ -336,102 +336,6 @@ void vocab_decypher_said_block(EngineState *s, byte *addr) {
sciprintf("\n");
}
-
-#ifdef SCI_SIMPLE_SAID_CODE
-
-static const short _related_words[][2] = { // 0 is backwards, 1 is forward
- {0x800, 0x180}, // preposition
- {0x000, 0x180}, // article
- {0x000, 0x180}, // adjective
- {0x800, 0x000}, // pronoun
- {0x800, 0x180}, // noun
- {0x000, 0x800}, // auxiliary verb
- {0x800, 0x800}, // adverb
- {0x000, 0x180}, // verb
- {0x000, 0x180} // number
-};
-
-int vocab_build_simple_parse_tree(parse_tree_node_t *nodes, WordMap &words) {
- int i, length, pos = 0;
-
- for (i = 0; i < words.size(); ++i) {
- if (words[i]._class != VOCAB_CLASS_ANYWORD) {
- nodes[pos].type = words[i]._class;
- nodes[pos].content.value = words[i]._group;
- pos += 2; // Link information is filled in below
- }
- }
- nodes[pos].type = -1; // terminate
- length = pos >> 1;
-
- // now find all referenced words
-#ifdef SCI_SIMPLE_SAID_DEBUG
- sciprintf("Semantic references:\n");
-#endif
-
- for (i = 0; i < length; i++) {
- int j;
- int searchmask;
- int type;
-
- pos = (i << 1);
- type = sci_ffs(nodes[pos].type);
-
- if (type) {
- int found = -1;
-
- type -= 5; // 1 because ffs starts counting at 1, 4 because nodes[pos].type is a nibble off
- if (type < 0)
- type = 0;
-#ifdef SCI_SIMPLE_SAID_DEBUG
- sciprintf("#%d: Word %04x: type %04x\n", i, nodes[pos].content.value, type);
-#endif
-
- // search backwards
- searchmask = _related_words[type][0];
- if (searchmask) {
- for (j = i - 1; j >= 0; j--)
- if (nodes[j << 1].type & searchmask) {
- found = j << 1;
- break;
- }
- }
- nodes[pos+1].content.branches[0] = found;
-#ifdef SCI_SIMPLE_SAID_DEBUG
- if (found > -1)
- sciprintf(" %d <\n", found >> 1);
-#endif
-
- // search forward
- found = -1;
- searchmask = _related_words[type][1];
- if (searchmask) {
- for (j = i + 1; j < length; j++)
- if (nodes[j << 1].type & searchmask) {
- found = j << 1;
- break;
- }
- }
-#ifdef SCI_SIMPLE_SAID_DEBUG
- if (found > -1)
- sciprintf(" > %d\n", found >> 1);
-#endif
- } else {
-#ifdef SCI_SIMPLE_SAID_DEBUG
- sciprintf("#%d: Untypified word\n", i); /* Weird, but not fatal */
-#endif
- nodes[pos + 1].content.branches[0] = -1;
- nodes[pos + 1].content.branches[1] = -1;
- }
- }
-#ifdef SCI_SIMPLE_SAID_DEBUG
- sciprintf("/Semantic references.\n");
-#endif
-
- return 0;
-}
-#endif
-
bool vocab_tokenize_string(ResultWordList &retval, const char *sentence, const WordMap &words,
const SuffixList &suffixes, char **error) {
const char *lastword = sentence;