respec icon indicating copy to clipboard operation
respec copied to clipboard

Consider dropping pluralize library

Open sidvishnoi opened this issue 4 years ago • 3 comments

We should be able to reduce respec scripts size by at least 10KB if we drop pluralize, and replace it with custom rules that match our needs.

Mainly, it includes hard-coded words that specs are unlikely to use, and the number of those words will only increase for robustness. Words such as:

    ['tornado', 'tornadoes'],
    ['torpedo', 'torpedoes'],
    // Ends with `us`.
    ['genus', 'genera'],
    ['viscus', 'viscera'],
    // Ends with `ma`.
    ['stigma', 'stigmata'],
    ['stoma', 'stomata'],
    ['dogma', 'dogmata'],
    ['lemma', 'lemmata'],
    ['schema', 'schemata'],
    ['anathema', 'anathemata'],
    // Other irregular rules.
    ['ox', 'oxen'],
    ['axe', 'axes'],
    ['die', 'dice'],
    ['yes', 'yeses'],

sidvishnoi avatar Apr 02 '21 14:04 sidvishnoi

“datum” / “data” might get some use in specs.

gkellogg avatar Apr 02 '21 14:04 gkellogg

This seems rather painful for editors to maintain (or for us to maintain). I'd rather keep the library and just deal with edge cases via aliases.

marcoscaceres avatar Apr 03 '21 14:04 marcoscaceres

The way to do this would be to automagically collect as many pluralisations as possible over, say, about 3-6 months, and then use that as the basis on which to build the list... that should cover most use cases. Alternatively, we pluralise on the server, but that will probably be slower than just taking the 10k hit.

I'm mostly inclined to close this tho. It seems rather low priority.

marcoscaceres avatar Apr 26 '21 08:04 marcoscaceres