Allow some SIG refs to be picked up from comments without separate SIG name. Closes #134

This commit is contained in:
Ian Renton
2026-08-31 20:49:15 +01:00
parent e4738b2c7d
commit 892827f1f8
15 changed files with 111 additions and 49 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import logging
import re
import simplejson
from pyhamtools.frequency import freq_to_band
@@ -30,10 +31,10 @@ def infer_mode_from_comment(comment):
"""Infer a mode from the comment"""
for mode in ALL_MODES:
if mode in comment.upper():
if re.match(r"(^|\W)" + mode + r"(^|\W)", comment, re.IGNORECASE):
return mode
for mode in MODE_ALIASES:
if mode in comment.upper():
if re.match(r"(^|\W)" + mode + r"(^|\W)", comment, re.IGNORECASE):
return MODE_ALIASES[mode]
return None