diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-04 01:20:24 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-04 01:20:24 +0000 |
commit | e99482b467e5cfe80a476f49eae8d398eab79440 (patch) | |
tree | e3234d9df4dc8bb9882712680e68d8254a943f87 | |
parent | e0c16e3e44b4b97c89f590fa063c0d6bb341fe50 (diff) | |
download | crawl-ref-e99482b467e5cfe80a476f49eae8d398eab79440.tar.gz crawl-ref-e99482b467e5cfe80a476f49eae8d398eab79440.zip |
Merge r7739 and r7740: conjugation and pluralization fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@7741 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/libutil.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc index 1b4826c8ca..0175291628 100644 --- a/crawl-ref/source/libutil.cc +++ b/crawl-ref/source/libutil.cc @@ -15,6 +15,7 @@ #include "defines.h" #include "directn.h" #include "initfile.h" +#include "itemname.h" // is_vowel() #include "libutil.h" #include "externs.h" #include "macro.h" @@ -332,7 +333,14 @@ std::string pluralise(const std::string &name, } else if (ends_with(name, "y")) { - return name.substr(0, name.length() - 1) + "ies"; + if (name == "y") + return ("ys"); + // day -> days, boy -> boys, etc + else if (is_vowel(name[name.length() - 2])) + return name + "s"; + // jelly -> jellies + else + return name.substr(0, name.length() - 1) + "ies"; } else if (ends_with(name, "fe")) { diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 525ee2681a..c4431e63eb 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -4356,6 +4356,12 @@ std::string monsters::conj_verb(const std::string &verb) const if (verb == "are") return ("is"); + if (ends_with(verb, "f") || ends_with(verb, "fe") + || ends_with(verb, "y")) + { + return (verb + "s"); + } + return (pluralise(verb)); } |