Skip to content

Commit

Permalink
fix #182
Browse files Browse the repository at this point in the history
  • Loading branch information
Belissimo-T committed Sep 26, 2023
1 parent 53b6460 commit fda9d22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions backend/lesson_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@


class _InfoParsers:
_teacher_name = r"[A-ZÄÖÜ][a-zäöüß]+(?: [A-ZÄÖÜ][a-zäöüß]+(?:-[A-ZÄÖÜ][a-zäöüß]+|\.)?)+"
_teacher_abbreviation = r"[A-ZÄÖÜ][A-ZÄÖÜa-zäöüß]*"
_teacher_name = (r"[A-ZÄÖÜ][a-zäöüß]+(?: [A-ZÄÖÜ][a-zäöüß]+(?:-[A-ZÄÖÜ][a-zäöüß]+)?\.?)*"
r"(?: [A-ZÄÖÜ][a-zäöüß]+(?:-[A-ZÄÖÜ][a-zäöüß]+)?)")
_teacher_abbreviation = r"[A-ZÄÖÜ][A-ZÄÖÜa-zäöüß]{2,}"
_teacher = fr"(?:{_teacher_name})|(?:{_teacher_abbreviation})"

# teacher a,teacher b
Expand Down Expand Up @@ -819,7 +820,7 @@ def add_fuzzy_teachers(text: str, teacher_abbreviation_by_surname: dict[str, str
segments = []

prev = 0
for match in re.finditer(r"\b\w+", text):
for match in re.finditer(rf"{_InfoParsers._teacher}|\b\w+", text):
segments.append(LessonInfoTextSegment(text[prev:match.start()]))
prev = match.end()

Expand Down
2 changes: 1 addition & 1 deletion backend/plan_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


class PlanProcessor:
VERSION = "78"
VERSION = "79"

def __init__(self, cache: Cache, school_number: str, *, logger: logging.Logger):
self._logger = logger
Expand Down

0 comments on commit fda9d22

Please sign in to comment.