Preserve semantic note layouts and checkpoint on provider quota failures
This commit is contained in:
@@ -29,7 +29,8 @@ def sanitize_automatic_terms(terms, ambiguous_aliases):
|
||||
keep = []
|
||||
for alias in term.get('aliases', []):
|
||||
unsafe = alias.casefold() in COMMON_ALIASES or re.fullmatch(r'[a-z]+', alias)
|
||||
if re.fullmatch(r'[A-Za-z][A-Za-z.-]*', alias) and alias != term['source']:
|
||||
alias_core = re.sub(r'^(?:the|a|an)\s+', '', alias, flags=re.IGNORECASE)
|
||||
if re.fullmatch(r'[A-Za-z][A-Za-z.-]*', alias_core) and alias != term['source']:
|
||||
acronym = bool(re.fullmatch(r'[A-Z][A-Z.-]+', alias))
|
||||
nickname = 'nickname' in term.get('notes', '').casefold() and alias in term.get('notes', '')
|
||||
if not acronym and not nickname:
|
||||
|
||||
Reference in New Issue
Block a user