Skip to content

Commit 8237c70

Browse files
authored
Merge pull request #109 from dlyongemallo/master
Accept a new tag "epithet" for "excl" entries.
2 parents 034d1fd + 9892193 commit 8237c70

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
CHANGELOG
22

3+
2021-04-09: Treat epithets as beings capable of language for the purposes of analysis.
4+
2021-04-07: Add {qolqoS} font.
35
2021-03-28: Fixed bug where inhps words displayed wrong message about plural suffix.
46
2021-02-22: Minor bug fixes. Added support for Anki decks and KLCP1 vocabulary.
57
2021-02-06: Improve database upgrade logic.

app/src/main/java/org/tlhInganHol/android/klingonassistant/KlingonContentProvider.java

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
<string name="font_latin">Off</string>
185185
<string name="font_tng">TNG-style</string>
186186
<string name="font_dsc">DSC-style</string>
187-
<string name="font_core">{qolqoS}</string>
187+
<string name="font_core">\"Sans-serif\"-style</string>
188188

189189
<!-- Choices for secondary languages. -->
190190
<string name="secondary_language_none">None</string>

0 commit comments

Comments
 (0)