-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Migrate names to snippets & add weighted snippets #70279
Conversation
Thank you for doing this. I was very surprised that <given_name> (etc) didn't work in dialogue. The names in that file in MoM were the top 500 most common given and family names in Massachusetts in (I think) 1990, so they would fit DDA's setting if you wanted to migrate them. |
Anything that stops us from merging this PR?
i think it's fine to have donors names in |
I haven't got the time to test this PR yet. I'll probably do it in a few days. |
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.
Auto-requesting reviews from non-collaborators: @Standing-Storm
The tests keep failing for unrelated reasons 🤷. |
Append names from the removed files into corresponding lists in names/en.json, sort the lists, and remove duplicate entries. The given names from MoM are not added, because they lack gender info required by the lists.
…0279 Family and given names from names/en.json are converted to translated names from the Japanese mo file before CleverRaven#70279 using a script. The translated names are then appended to lists in names/ja.json, sorted, and made unique. Translations that are not names are then removed. (They are easy to locate after sorting, because the Japanese translators translated names using half-width katakana exclusively.)
…verRaven#70279 Family and given names from names/en.json are converted to translated names from the Simplified Chinese mo file before CleverRaven#70279 using a script. The translated names are then appended to lists in names/zh_CN.json, sorted, and made unique. Translations that are not names are then removed manually.
…en#70279 Family and given names from names/en.json are converted to translated names from the Russian mo file before CleverRaven#70279 using a script. The translated names are then appended to lists in names/ru.json, sorted, and made unique.
Family and given names from names/en.json are converted to translated names from the Russian mo file before CleverRaven#70279 and added to names/ru.json using a script.
(Help wanted with reviewing) (#73083) * Add Russian names from translated name snippets before #70279 Family and given names from names/en.json are converted to translated names from the Russian mo file before #70279 and added to names/ru.json using a script. * Fix some incorrectly translated Russian names, thanks Hyperseeker, Zireael07, and Vane79! Co-authored-by: Steve Brand <[email protected]> * Fix more incorrectly translated Russian names * Fix more incorrectly translated Russian names, thanks Hyperseeker and Vane79! Co-authored-by: Steve Brand <[email protected]> * Update ru.json * Fix more incorrectly translated Russian names Co-authored-by: Steve Brand <[email protected]> --------- Co-authored-by: Steve Brand <[email protected]> Co-authored-by: Uwuewsky <[email protected]>
…verRaven#70279 (Help wanted with reviewing) (CleverRaven#73083) * Add Russian names from translated name snippets before CleverRaven#70279 Family and given names from names/en.json are converted to translated names from the Russian mo file before CleverRaven#70279 and added to names/ru.json using a script. * Fix some incorrectly translated Russian names, thanks Hyperseeker, Zireael07, and Vane79! Co-authored-by: Steve Brand <[email protected]> * Fix more incorrectly translated Russian names * Fix more incorrectly translated Russian names, thanks Hyperseeker and Vane79! Co-authored-by: Steve Brand <[email protected]> * Update ru.json * Fix more incorrectly translated Russian names Co-authored-by: Steve Brand <[email protected]> --------- Co-authored-by: Steve Brand <[email protected]> Co-authored-by: Uwuewsky <[email protected]>
Summary
Infrastructure "Migrate names to snippets & add weighted snippets"
Purpose of change
Unify the name snippets to use the strings in
names/*.json
everywhere. This should also relieve translators of the burden of having to translate gazillions of names, and fixes #70023:(Over 10k strings untranslated, of which several thousand are names...)
This also implements weighted snippets so that snippets can now have different probabilities to be chosen, which is used to generate full names with snippets.
Describe the solution
Migrate code from
name.h/cpp
totext_snippets.h/cpp
, and update related cpp/json code to use the snippet library and unified name tags.The second commit adds weighted snippets, which accepts a
"weight"
value along with the snippet"text"
, and the weight value is used when selecting random snippets from a category by considering all weight values in the same category.Describe alternatives you've considered
Further migrate the name snippets to the normal snippet format, but the current format has the advantage of not requiring translations to have the same number of entries in the name list, which is not supported by the snippet format.
The removed names in dda and Mind Over Matter could be added to
names/*.json
maybe? @MNG-cataclysm @Standing-Storm what are your thoughts?Testing
Tested creating worlds and characters, spawning NPCs and cities, and other related changes, and the names were generated correctly.
Additional context
I notice that the current snippets use
<full_name>
in multiple places, but<full_name>
was actually expanded into the names of the crowdfunding donors, so I'd like some input on whether those are supposed to be any full name or only donor names.The ~10000 deletion is mostly due to the removal of the snippet name lists.