-
-
Notifications
You must be signed in to change notification settings - Fork 977
fix(locale): weight common chinese surnames more frequently #3467
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
base: next
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3467 +/- ##
==========================================
- Coverage 99.97% 99.97% -0.01%
==========================================
Files 2830 2830
Lines 218533 218538 +5
Branches 951 951
==========================================
+ Hits 218480 218483 +3
- Misses 53 55 +2
🚀 New features to boost your workflow:
|
@@ -1,4 +1,26 @@ | |||
export default { | |||
generic_common: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this extra key as it is not included in the module definitions type contract. I'd be in favor to allow (not enforce!) weighted lists in the name schemas in general. I could see this being introduced as a workaround at most for now.
zh_TW (Taiwan) also only includes a subset of common surnames, and it works quite well. so I think zh_CN could do the same — weighting may not be necessary (consider If you're aligned with this idea, I'm happy to submit a PR for the change (pick surnames), which would only change the locals. |
I'm not 100% sure this is the best approach (versus just using common surnames) though I'd say the fact that generic_common is not in the module definition is not enough to disqualify it as an approach, there are plenty of other edge cases in the locales which use non-standard keys. For example company.legal_entity_type and company.category used in various definitions and locales. |
POC to fix #3466
Weights 20 common Chinese surnames to appear 80% of the time