fix github issue #552 - "an ukulele"
Add "ukulele" to the exceptions that yield "a u<something>" in case someone names their fruit that. Add the shortened form "uke" too. While in there, generalize "one" handling to accept "one", "one<space> <anything>" and "one<underscore><anything>" as exceptions in addition to existing "one<dash><anything>", and "eu<anything>" to replace existing "eucalyptus". Fixes #552
This commit is contained in:
@@ -569,6 +569,7 @@ defer encumbrance check during polymorph to new man; newman() -> redist_attr()
|
|||||||
-> encumber_msg() could report change in encumbrance that immediately
|
-> encumber_msg() could report change in encumbrance that immediately
|
||||||
became obsolete if polyman() subsequently restored old attributes
|
became obsolete if polyman() subsequently restored old attributes
|
||||||
fix heap-use-after-free when attacking monster with potion
|
fix heap-use-after-free when attacking monster with potion
|
||||||
|
for "a" vs "an", add ukulele and uke as exceptions for "an u<anything>"
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
14
src/objnam.c
14
src/objnam.c
@@ -1685,10 +1685,16 @@ just_an(char *outbuf, const char *str)
|
|||||||
|| !strcmpi(str, "iron bars") || !strcmpi(str, "ice")) {
|
|| !strcmpi(str, "iron bars") || !strcmpi(str, "ice")) {
|
||||||
; /* no article */
|
; /* no article */
|
||||||
} else {
|
} else {
|
||||||
if ((index(vowels, c0) && strncmpi(str, "one-", 4)
|
/* normal case is "an <vowel>" or "a <consonant>" */
|
||||||
&& strncmpi(str, "eucalyptus", 10) && strncmpi(str, "unicorn", 7)
|
if ((index(vowels, c0) /* some exceptions warranting "a <vowel>" */
|
||||||
&& strncmpi(str, "uranium", 7) && strncmpi(str, "useful", 6))
|
/* 'wun' initial sound */
|
||||||
|| (index("x", c0) && !index(vowels, lowc(str[1]))))
|
&& (strncmpi(str, "one", 3) || (str[3] && !index("-_ ", str[3])))
|
||||||
|
/* long 'u' initial sound */
|
||||||
|
&& strncmpi(str, "eu", 2) /* "eucalyptus leaf" */
|
||||||
|
&& strncmpi(str, "uke", 7) && strncmpi(str, "ukulele", 7)
|
||||||
|
&& strncmpi(str, "unicorn", 7) && strncmpi(str, "uranium", 7)
|
||||||
|
&& strncmpi(str, "useful", 6)) /* "useful tool" */
|
||||||
|
|| (c0 == 'x' && !index(vowels, lowc(str[1]))))
|
||||||
Strcpy(outbuf, "an ");
|
Strcpy(outbuf, "an ");
|
||||||
else
|
else
|
||||||
Strcpy(outbuf, "a ");
|
Strcpy(outbuf, "a ");
|
||||||
|
|||||||
Reference in New Issue
Block a user