Merge pull request 'fix(robot): rare dot between handle words, prefer underscore' (#74) from feature/robot-nick-separator into development
CI / changes (push) Successful in 2s
CI / unit (push) Successful in 9s
CI / integration (push) Successful in 14s
CI / ui (push) Has been skipped
CI / gate (push) Successful in 0s
CI / deploy (push) Successful in 1m0s

This commit was merged in pull request #74.
This commit is contained in:
2026-06-16 14:20:37 +00:00
+11 -8
View File
@@ -140,20 +140,23 @@ func cyrillicNick() string {
return assembleHandle(form, noun.word) return assembleHandle(form, noun.word)
} }
// assembleHandle joins an adjective and noun into a handle: a bare noun, the two joined // assembleHandle joins an adjective and noun into a handle: a bare noun, the two
// by "_" or "." or camel-cased, optionally followed by a trailing number. It keeps at // camel-cased ("DarkWolf"), or joined by a separator. Between two meaningful words a human
// most one separator so the result, the number aside, reads like a name a human could pick. // almost always uses "_" — a "." there is a rare tell — so the separator is an underscore
// far more often than a dot. An optional trailing number may follow.
func assembleHandle(adj, noun string) string { func assembleHandle(adj, noun string) string {
var base string var base string
switch rand.IntN(4) { switch rand.IntN(4) {
case 0: case 0:
base = noun base = noun // a bare noun
case 1: case 1:
base = adj + "_" + noun base = adj + noun // camel-cased
case 2:
base = adj + "." + noun
default: default:
base = adj + noun sep := "_"
if rand.IntN(10) == 0 {
sep = "." // a dot between two words is rare
}
base = adj + sep + noun
} }
if rand.IntN(2) == 0 { if rand.IntN(2) == 0 {
base += nickNumber() base += nickNumber()