Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pluralize("audio") === "audio" #37

Open
SISIGNA opened this issue Aug 29, 2020 · 3 comments
Open

pluralize("audio") === "audio" #37

SISIGNA opened this issue Aug 29, 2020 · 3 comments

Comments

@SISIGNA
Copy link

SISIGNA commented Aug 29, 2020

Sometimes the plural of a word equals its singular. For instance I had a table "audio" and pluralize.js generates "audio" as plural. Which is I think correct (for the curious, compare "video").

Anyways, it that was a hard to spot bug for me and I think there should be some mechanism to avoid this.

@SISIGNA
Copy link
Author

SISIGNA commented Aug 29, 2020

Another case where the simple pluralize does not work well in my view is e.g.:

  • PageAbout
  • PageHome
  • PageCredits

they're all singular, even the third one. But we get some "PageAbouts", "PageHomes", "PageCredits"

The solution is of course to use postfix instead of prefix. (AboutPage, HomePage, CreditsPage)
However, I find this a bit limiting.

@macrozone
Copy link
Member

same as #32

its an upstream issue. nexus-plugin-prisma suffers from the same problem

graphql-nexus/nexus-plugin-prisma#804

@gnibblz
Copy link

gnibblz commented Jul 21, 2023

Happened across this thread while looking for a completely unrelated issue. I know its ancient by now but wanted to add my own personal insight since nothing very resolute has been said yet:

This is indeed an "upstream" issue but more so in the linguistic/philisophical sense than the technical.

"Audio" is an uncountable/mass noun. Other examples include music, information, rice, milk, advice, etc.. This class of words was conceived because it's useful as a means to help people conceptualize related things that we don't usually think of in distinct countable units.

In effect, I would argue that uncountable/mass nouns are fundamentally unsuitable for class/entity names in the realms of programming & data science. Not truly understanding the nature of what you intended to embody with the word "audio" (the most immediate indicator of unsuitability from my perspective): AudioFile, AudioInstance, or just "sound" would be much better candidates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants