(text: Any, limit: int = 80)
| 510 | |
| 511 | |
| 512 | def extract_code_names(text: Any, limit: int = 80) -> List[str]: |
| 513 | raw = clean_text(text).upper() |
| 514 | if not raw: |
| 515 | return [] |
| 516 | found = [] |
| 517 | for match in re.finditer(r"\b[A-Z]{1,4}-\d{1,3}(?:[A-Z]{1,2}|-\d{1,3}(?:-[A-Z0-9]{1,8})?)?\b", raw): |
| 518 | code = match.group(0).strip() |
| 519 | if looks_like_code_product_name(code): |
| 520 | found.append(code) |
| 521 | if len(found) >= limit: |
| 522 | break |
| 523 | return unique_keep_order(found) |
| 524 | |
| 525 | |
| 526 | def extract_price_text_from_any(value: Any) -> str: |
no test coverage detected