Explorer
/proc/4/root/tmp/aa050_patch6.py
← Zurück ↓ Download
from pathlib import Path
p=Path('/opt/struktur/social-media-radar/mas_relevance.py'); s=p.read_text()
old='''    if any(term in folded for term in FOOD_CONTEXT + TV_CONTEXT + SPORT_CONTEXT) and not any(term in folded for term in ("wand", "wohnung", "haus", "immobil", "raum", "gebäude", "gebaeude", "lüft", "lueft", "feuchte", "kondens")):
        return MASRelevance(False, [], False, "", "Kein fachlicher MAS-Anker")
'''
new='''    context_terms = tuple(_fold(term) for term in FOOD_CONTEXT + TV_CONTEXT + SPORT_CONTEXT)
    building_terms = ("wand", "wohnung", "haus", "immobil", "raum", "gebäude", "gebaeude", "lüft", "lueft", "feuchte", "kondens")
    if any(term in folded for term in context_terms) and not any(term in folded for term in building_terms):
        return MASRelevance(False, [], False, "", "Kein fachlicher MAS-Anker")
'''
assert old in s
p.write_text(s.replace(old,new))