speced / respec

A tool for creating technical documents and web standards
https://respec.org/
Other
717 stars 386 forks source link

Consider dropping pluralize library #3434

Open sidvishnoi opened 3 years ago

sidvishnoi commented 3 years ago

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'],
gkellogg commented 3 years ago

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

marcoscaceres commented 3 years ago

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 commented 3 years ago

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.