Skip to content

Commit

Permalink
TITANIC: Add German handling to getSuffixedWord
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jun 22, 2017
1 parent 0f084fb commit 007776b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions engines/titanic/true_talk/tt_vocab.cpp
Expand Up @@ -232,6 +232,27 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
TTstring tempStr(str);
TTword *word = nullptr;

if (g_vm->isGerman()) {
static const char *const SUFFIXES[13] = {
"est", "em", "en", "er", "es", "et", "st",
"s", "e", "n", "t"
};

for (int idx = 0; idx < 13; ++idx) {
if (tempStr.hasSuffix(SUFFIXES[idx])) {
tempStr.deleteSuffix(strlen(SUFFIXES[idx]));
word = getPrimeWord(tempStr);
if (word)
break;
tempStr = str;
}
}

if (word)
word->setSynStr(str);
return word;
}

if (tempStr.hasSuffix("s")) {
tempStr.deleteSuffix(1);
word = getPrimeWord(tempStr);
Expand Down

0 comments on commit 007776b

Please sign in to comment.