TITANIC: Parser fixes

This commit is contained in:
Paul Gilbert 2016-11-02 21:31:14 -04:00
parent 1846ef7850
commit 8abe97dfda
4 changed files with 10 additions and 4 deletions

View File

@ -40,7 +40,8 @@ void CTitleEngine::setup(int val1, int val2) {
/*------------------------------------------------------------------------*/
STtitleEngine::STtitleEngine(): CTitleEngine(), _responseP(nullptr) {
STtitleEngine::STtitleEngine(): CTitleEngine(),
_responseP(nullptr), _stream(nullptr) {
}
STtitleEngine::~STtitleEngine() {

View File

@ -29,11 +29,14 @@ namespace Titanic {
TTconceptNode::TTconceptNode() : _concept0P(_concepts[0]), _concept1P(_concepts[1]),
_concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]),
_concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) {
Common::fill(&_concepts[0], &_concepts[6], (TTconcept *)nullptr);
}
TTconceptNode::TTconceptNode(const TTconceptNode &src) : _concept0P(_concepts[0]), _concept1P(_concepts[1]),
_concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]),
_concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) {
Common::fill(&_concepts[0], &_concepts[6], (TTconcept *)nullptr);
if (src._status) {
_status = SS_5;
} else {

View File

@ -489,7 +489,7 @@ int TTparser::findFrames(TTsentence *sentence) {
break;
TTword *srcWord = nullptr;
TTword *word = _owner->_vocab->getWord(wordString, &word);
TTword *word = _owner->_vocab->getWord(wordString, &srcWord);
sentence->storeVocabHit(srcWord);
if (!word && ctr == 1) {

View File

@ -111,7 +111,7 @@ TTstring TTstring::tokenize(const char *delim) {
const char *strP = _data->_string.c_str();
const char *splitP = nullptr, *chP;
for (const char *d = delim; d; ++d) {
for (const char *d = delim; *d; ++d) {
chP = strchr(strP, *d);
if (chP && (splitP == nullptr || chP < splitP))
splitP = chP;
@ -122,7 +122,9 @@ TTstring TTstring::tokenize(const char *delim) {
_data->_string = CString(splitP + 1);
return result;
} else {
return TTstring();
TTstring result(strP);
_data->_string = CString();
return result;
}
}