If SuffixableElement is your interface, then StemmedSentence must derive from it.
Kerido
2010-03-05 08:00:04
If SuffixableElement is your interface, then StemmedSentence must derive from it.
// --- returns n-th sentence of this snippet
SuffixableElement* ArrayStemmedSnippet::getSentence(int n) {
// ...
return (SuffixableElement*)sentences[ n ];
}
'sentences' is an array of objects of the StemmedSentence class. StemmedSentence is not derived from SuffixableElement, that is it does not provide that interface.
Try the following:
class StemmedSentence : public ArrayStemmedSnippet, public SuffixableElement {
// ...
};
and
SuffixableElement* ArrayStemmedSnippet::getSentence(int n) {
StemmedSentence* sentence = sentences[ n ];
sentence->setParent(this);
return sentence;
}