Class Pluralizer

java.lang.Object
com.intellij.openapi.util.text.Pluralizer

public final class Pluralizer extends Object
A java version of http://github.com/blakeembrey/pluralize Revision: de7b35e700caccfb4e74923d98ab9b40006eda04 (Nov 19, 2017)

It tries to preserve the original structure for future sync.

Other sources of inspiration: http://www.csse.monash.edu.au/~damian/papers/HTML/Plurals.html (a java implementation: https://github.com/atteo/evo-inflector)

  • Constructor Details

    • Pluralizer

      public Pluralizer()
  • Method Details

    • restoreCase

      public static String restoreCase(String word, String result)
      Pass in a word token to produce a function that can replicate the case on another word.
    • pluralize

      @NotNull public @NotNull String pluralize(@NotNull @NotNull String word, int count, boolean inclusive)
      Pluralize or singularize a word based on the passed in count.
    • plural

      @Nullable public @Nullable String plural(@Nullable @Nullable String word)
    • singular

      @Nullable public @Nullable String singular(@Nullable @Nullable String word)