-
-
Notifications
You must be signed in to change notification settings - Fork 919
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
Lorem EN word.ts
contains a single character in the pool
#3261
Comments
word.ts
contains a single character in the poolword.ts
contains a single character in the pool
FFR: faker/src/locales/en/lorem/word.ts Line 2 in 467bd83
The English locale does have other one character (non-lorem) words as well (e.g. most prominently If you need words of a certain length, have you tried |
I understand your perspective, but this approach might be a bit abstract. For instance, the character If you're aiming for control over word length, I’d recommend focusing on ensuring that single characters don’t get pulled into word contexts, rather than adjusting word definitions. That way, we can keep words to truly represent terms rather than individual characters. |
Thanks for sharing your opinion. Is it possible for you to share
|
In a sense, these one character words have found the exact issue they are meant to find. Do you expect to get them, when you ask for a word? In this case: No
|
"a" is a valid Latin word like "a populo" (by the people) as is "e" (e pluribus unum). |
@matthewmayer Would you expect lorem.word() to return these one letter word? |
I agree with this. Having the one character word led to a conversation between two people which led to a better understanding of what the actual requirements for a parameter were. That's a good thing. Similarly having words like jalapeño in the English word list might help uncover a hidden requirement that a "word" is supposed to be ASCII #1538 |
This is probably the most accurate explanation; thank you, @matthewmayer . In my case, I opted not to use However, we can all agree that some words and characters overlap categories, which might be a bit confusing. Ideally, each string should fit the closest category—like Thank you all for the insights and the clarification! |
Pre-Checks
Describe the bug
I was using
lorem.word
for testing, and I had a failing test. I was confident enough to ping the developer:-"Hey, you have a bug here."
-"No, you are providing a single character when I expect a word of at least two characters."
-"No, I don't. I use a library that specifically uses random words, not chars".
-"Yes, you are. Here, see the payload you provided yourself."
-"Ah..."
And here I am :) There is an 'a' character here, which is NOT a word, so I do not think it should be in this pool.
Minimal reproduction code
No response
Additional Context
No response
Environment Info
Which module system do you use?
Used Package Manager
npm
The text was updated successfully, but these errors were encountered: