TITANIC: Added TTconcept id methods

This commit is contained in:
Paul Gilbert 2016-05-22 15:44:50 -04:00
parent 76c84afdfe
commit 73e2e8f429
4 changed files with 29 additions and 2 deletions

View File

@ -273,4 +273,12 @@ TTconcept *TTconcept::findByWordClass(WordClass wordClass) {
return nullptr;
}
bool TTconcept::isWordId(int id) const {
return this && _wordP && _wordP->_id == id;
}
int TTconcept::getWordId() const {
return this && _wordP ? _wordP->_id : 0;
}
} // End of namespace Titanic

View File

@ -135,6 +135,16 @@ public:
* Find a word by it's class
*/
TTconcept *findByWordClass(WordClass wordClass);
/**
* Returns true if the concept has a word with a given Id
*/
bool isWordId(int id) const;
/**
* If a word is associated, return it's Id
*/
int getWordId() const;
};
} // End of namespace Titanic

View File

@ -48,7 +48,9 @@ public:
*/
virtual TTword *copy() const;
virtual bool proc19(int val) const { return _field30 == val; }
virtual bool comparePronounTo(int val) const {
return _field30 == val;
}
/**
* Dumps data associated with the word to file

View File

@ -124,6 +124,13 @@ public:
*/
bool compareTo(const char *str) const;
/**
* Compares the word's text to a passed string
*/
bool compareTo(TTstring *str) const {
return compareTo(str->c_str());
}
/**
* Return the status of the word
*/
@ -176,7 +183,7 @@ public:
virtual bool proc16() const { return false; }
virtual bool proc17() const { return false; }
virtual bool proc18() const { return false; }
virtual bool proc19(int val) const { return false; }
virtual bool comparePronounTo(int val) const { return false; }
virtual int proc20() const { return 0; }
/**