From 819bbbcaf482b5ce4e695e4cdfa69817531658eb Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sat, 18 Oct 2025 14:39:06 -0700 Subject: [PATCH] enhance --- modules/locationdata.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/locationdata.py b/modules/locationdata.py index 90324e3..079b130 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -352,7 +352,9 @@ def abbreviate_noaa(row): } line = row - for key, value in replacements.items(): + # Sort keys by length, longest first + for key in sorted(replacements, key=len, reverse=True): + value = replacements[key] for variant in (key, key.capitalize(), key.upper()): if variant != value: line = line.replace(variant, value)