@@ -482,6 +482,9 @@ private enum SentenceType {
482482
483483 private SentenceType mSentenceType = SentenceType .PHRASE ;
484484
485+ // Exclamation attributes.
486+ boolean mIsEpithet = false ;
487+
485488 // Categories of words and phrases.
486489 boolean mIsAnimal = false ;
487490 boolean mIsArchaic = false ;
@@ -748,6 +751,12 @@ private void processMetadata() {
748751 } else if (attr .equals ("joke" )) {
749752 mSentenceType = SentenceType .JOKE ;
750753
754+ // Exclamation attributes.
755+ } else if (attr .equals ("epithet" )) {
756+ mIsEpithet = true ;
757+ // TODO: Determine whether epithets are treated as if they always implicitly refer to
758+ // beings capable of language, and if so, set mIsBeingCapableOfLanguage to true here.
759+
751760 // Categories.
752761 } else if (attr .equals ("anim" )) {
753762 mIsAnimal = true ;
@@ -1422,6 +1431,10 @@ public boolean isPlural() {
14221431 return mIsPlural ;
14231432 }
14241433
1434+ public boolean isEpithet () {
1435+ return mIsEpithet ;
1436+ }
1437+
14251438 public boolean isArchaic () {
14261439 return mIsArchaic ;
14271440 }
@@ -1824,11 +1837,13 @@ public boolean isSatisfiedBy(Entry candidate) {
18241837 }
18251838 // The parts of speech must match, except when: we're looking for a verb, in which
18261839 // case a pronoun will satisfy the requirement; or we're looking for a noun, in which case
1827- // the question words {nuq} and {'Iv} are accepted. We have these exceptions because we want
1828- // to allow constructions like {ghaHtaH} and for those two question words to take the place
1829- // of the nouns they are asking about. Note that entries knows nothing about affixes, so
1830- // it's up to the caller to exclude, e.g., prefixes on pronouns. The homophony of {'Iv:ques}
1831- // and {'Iv:n} necessitates adding a homophone number to distinguish them.
1840+ // the question words {nuq} and {'Iv}, as well as exclamations which are epithets, are
1841+ // accepted. We have these exceptions because we want to allow constructions like {ghaHtaH},
1842+ // for those two question words to take the place of the nouns they are asking about, and
1843+ // to parse constructions such as {petaQpu'}. Note that entries knows nothing about affixes,
1844+ // so it's up to the caller to exclude, e.g., prefixes on pronouns. The homophony of
1845+ // {'Iv:ques} and {'Iv:n} necessitates adding a homophone number (in the database) to
1846+ // distinguish them.
18321847 // TODO: Remove redundant {nuq} + {-Daq}.
18331848 Log .d (TAG , "mBasePartOfSpeech: " + mBasePartOfSpeech );
18341849 Log .d (TAG , "candidate.getBasePartOfSpeech: " + candidate .getBasePartOfSpeech ());
@@ -1839,8 +1854,12 @@ public boolean isSatisfiedBy(Entry candidate) {
18391854 (mBasePartOfSpeech == BasePartOfSpeechEnum .NOUN
18401855 && (candidate .getEntryName ().equals ("nuq" )
18411856 || candidate .getEntryName ().equals ("'Iv" )));
1857+ boolean candidateIsExclamationActingAsNoun =
1858+ (mBasePartOfSpeech == BasePartOfSpeechEnum .NOUN && candidate .isEpithet ());
18421859 if (mBasePartOfSpeech != candidate .getBasePartOfSpeech ()) {
1843- if (!candidateIsPronounActingAsVerb && !candidateIsQuestionWordActingAsNoun ) {
1860+ if (!candidateIsPronounActingAsVerb
1861+ && !candidateIsQuestionWordActingAsNoun
1862+ && !candidateIsExclamationActingAsNoun ) {
18441863 return false ;
18451864 }
18461865 }
0 commit comments