Is String # pluralizing idempotent?

That is, for any string string , the following is true:

 string.pluralize == string.pluralize.pluralize 
+7
source share
2 answers

pluralize is NOT Idempotent. I can prove this with an example (courtesy of a personal Facebook post that hit some geeks of the language).

 "taxi".pluralize => "taxis" "taxis".pluralize => "taxes" "taxi".pluralize.pluralize => "taxes" 

So, β€œtaxi” (what leads you) to β€œtaxi” (arrangement or order) to β€œtaxes” (proper pluralization of β€œtaxi”). I am sure there are other examples, but they are certainly difficult to find.

Despite evaluating or accepting this answer, but I couldn’t exactly put it in the commentary on the Ryan post.

+6
source

I can not think of a case when this is not so.

I just tried the following words and did not change after the second pluralization. However, some of them β€œbreak down” in interesting ways due to two reasons: 1) Rails pluralization rules are actually pretty stupid and 2) English is tough .

  • analysis β†’ analyzes β†’ analysis
  • media β†’ media β†’ media
  • news β†’ news β†’ news
  • cactii β†’ cactiis β†’ cactiis
  • criterion β†’ criteria β†’ criteria
  • foot β†’ foots β†’ foots
  • loaf β†’ loafs β†’ loafs
  • people β†’ people β†’ people
+4
source

All Articles