[Scummvm-git-logs] scummvm master -> 9b51c1dbbd1a4cb894080e73cfde7d84517131ed
dreammaster
dreammaster at scummvm.org
Sat Oct 7 02:37:34 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9b51c1dbbd TITANIC: DE: Fix recognising words with common suffixes
Commit: 9b51c1dbbd1a4cb894080e73cfde7d84517131ed
https://github.com/scummvm/scummvm/commit/9b51c1dbbd1a4cb894080e73cfde7d84517131ed
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-10-06T20:37:28-04:00
Commit Message:
TITANIC: DE: Fix recognising words with common suffixes
Changed paths:
engines/titanic/true_talk/tt_vocab.cpp
engines/titanic/true_talk/tt_vocab.h
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 861d8f8..5ed163f 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -182,10 +182,10 @@ TTword *TTvocab::getWord(TTstring &str, TTword **srcWord) const {
if (!word) {
TTstring tempStr(str);
if (tempStr.size() > 2) {
- word = getSuffixedWord(tempStr);
+ word = getSuffixedWord(tempStr, srcWord);
if (!word)
- word = getPrefixedWord(tempStr);
+ word = getPrefixedWord(tempStr, srcWord);
}
}
@@ -230,11 +230,11 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
return newWord;
}
-TTword *TTvocab::getSuffixedWord(TTstring &str) const {
+TTword *TTvocab::getSuffixedWord(TTstring &str, TTword **srcWord) const {
TTstring tempStr(str);
TTword *word = nullptr;
- if (g_vm->isGerman()) {
+ if (g_language == Common::DE_DEU) {
static const char *const SUFFIXES[11] = {
"est", "em", "en", "er", "es", "et", "st",
"s", "e", "n", "t"
@@ -243,7 +243,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
for (int idx = 0; idx < 11; ++idx) {
if (tempStr.hasSuffix(SUFFIXES[idx])) {
tempStr.deleteSuffix(strlen(SUFFIXES[idx]));
- word = getPrimeWord(tempStr);
+ word = getPrimeWord(tempStr, srcWord);
if (word)
break;
tempStr = str;
@@ -514,7 +514,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
return word;
}
-TTword *TTvocab::getPrefixedWord(TTstring &str) const {
+TTword *TTvocab::getPrefixedWord(TTstring &str, TTword **srcWord) const {
TTstring tempStr(str);
TTword *word = nullptr;
int prefixLen = 0;
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index 7e5cc29..def42ba 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -68,7 +68,7 @@ private:
* @param str Word to check
* @returns New word instance for found match, or nullptr otherwise
*/
- TTword *getSuffixedWord(TTstring &str) const;
+ TTword *getSuffixedWord(TTstring &str, TTword **srcWord = nullptr) const;
/**
* Checks the passed word for common prefixes, and checks for a word
@@ -76,7 +76,7 @@ private:
* @param str Word to check
* @returns New word instance for found match, or nullptr otherwise
*/
- TTword *getPrefixedWord(TTstring &str) const;
+ TTword *getPrefixedWord(TTstring &str, TTword **srcWord = nullptr) const;
public:
TTvocab(VocabMode vocabMode);
~TTvocab();
More information about the Scummvm-git-logs
mailing list