public int getNumberOfWords() {
        int count = 0;
        for (SentencePart sp : sentence) {
            if (sp instanceof Word) {
                count++;
            }
        }
        return count;
    }