calfzhou / self-descriptive-sentence

A self-descriptive sentence generator. Targeting on any languages.
MIT License
6 stars 1 forks source link

Need support pluralizing #2

Open calfzhou opened 10 years ago

calfzhou commented 10 years ago

When using English as sentence language, we are facing this problem. You could say "there are two a's" or "there is one a", but cannot say "there are one a's" or "there is two a".

There are two problems (or maybe just one):

  1. "are"/"is" adjusting
  2. with/without the final "s"
calfzhou commented 10 years ago

For the "s" issue, an easy way is to treat it as the result of a number. All numbers except 0 and 1 will return an additional "s" for counting. So there is no change to the core algorithm. But need a good way to clearly define it in the template/language object.

The "are/is" issue is similar - addition "is" is return when translating 1 while addition "are" for all other number larger than 1.