I have a question about this class:
A word has a lemma and a (grammatical) category, for example "cat" (lemma) is a "substantive" (category).Code:class Word {
public:
Word();
...
private:
string lemma;
string category;
};
Another example: "The" is an "article".
If I derive subclasses from this class Word, for example:
Isn't the member "category" of the class "Word" superfluous? Because, if you make an instance of Article, then it will be clear that the category is "article".Code:class Article: public Word {
public:
Article(string lemma);
....
private:
bool definite;
};
On the other hand, if you're just handling items of type Word, then the category can be very relevant.
So my question is: do I have to keep the member category of class Word or is this bad OOP practice?