fix: /B was not recognized in the cluster
This commit is contained in:
@@ -303,11 +303,12 @@ func normalizeCallsign(s string) string {
|
|||||||
if p == "" {
|
if p == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// A TRAILING /MM (maritime) or /AM (aeronautical) mobile is stripped and
|
// A TRAILING /MM (maritime) or /AM (aeronautical) mobile, or /B (beacon), is
|
||||||
// the operator's home entity is kept, so the contact still resolves to a
|
// stripped and the operator's home entity is kept, so the contact still
|
||||||
// country in the log (e.g. YB1SCY/AM → Indonesia). A LEADING "MM" is the
|
// resolves to a country in the log (e.g. YB1SCY/AM → Indonesia, 4U1UN/B →
|
||||||
// Scotland operating prefix (MM/F4NIE) and must NOT be stripped.
|
// 4U1UN → United Nations HQ). A LEADING "MM"/"B" is a PREFIX (MM = Scotland,
|
||||||
if i > 0 && (p == "MM" || p == "AM") {
|
// B = China: B/F4NIE) and must NOT be stripped.
|
||||||
|
if i > 0 && (p == "MM" || p == "AM" || p == "B") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if suffixModifiers[p] {
|
if suffixModifiers[p] {
|
||||||
|
|||||||
@@ -224,6 +224,8 @@ func TestNormalize(t *testing.T) {
|
|||||||
"MM/LY3X/P": "MM",
|
"MM/LY3X/P": "MM",
|
||||||
"F4BPO/W6": "W6",
|
"F4BPO/W6": "W6",
|
||||||
"VK9/F4BPO": "VK9",
|
"VK9/F4BPO": "VK9",
|
||||||
|
"4U1UN/B": "4U1UN", // trailing /B = beacon → strip, keep the base call
|
||||||
|
"B/F4BPO": "B", // leading B = China operating prefix, NOT a beacon
|
||||||
}
|
}
|
||||||
for in, want := range cases {
|
for in, want := range cases {
|
||||||
if got := normalizeCallsign(in); got != want {
|
if got := normalizeCallsign(in); got != want {
|
||||||
|
|||||||
Reference in New Issue
Block a user