Spaces:
Sleeping
Sleeping
Create src/regx/concepts.py
Browse files12345678910111213141516171819from __future__ import annotationsimport refrom typing import List
PATTERNS = { "REMOTE_ID_BCAST": [r"\b(remote|electronic)\s+id(entification)?\b", r"\b(broadcast|bluetooth|wi-?fi)\b"], "GEOAWARENESS": [r"\bgeo[-\s]?awareness\b|\bno[-\s]?fly\b|\brestricted\s+area\b"], "U_SPACE_NETWORK_RID": [r"\bnetwork\s+remote\s+id(entification)?\b", r"\bservice\b"], "OPERATION_CATEGORIES": [r"\b(open|specific|certified)\b\s+(category|operation)"],}
def auto_concepts(text: str) -> List[str]: low = text.lower() hits = [] for cid, regexes in PATTERNS.items(): score = sum(1 for rx in regexes if re.search(rx, low)) if score >= max(1, len(regexes) - 1): hits.append(cid) return hitssrc/regx/concepts.pyAdded+19