Match case insensitive

This commit is contained in:
2021-02-14 13:10:01 +01:00
parent 9d94f08428
commit f24996512d
3 changed files with 11 additions and 8 deletions

View File

@ -15,6 +15,7 @@
# limitations under the License.
import configparser
import os
import re
from datetime import date
from datetime import time
from typing import List
@ -174,16 +175,16 @@ def get_abbreviated_committee_name(name: str, district: str) -> str:
start_youth_help_committee = "Sitzung des Jugendhilfeausschusses"
start_other_committee = "Sitzung des"
end_other_committee = "ausschusses"
start_video_conf1 = "NICHTÖFFENTLICHE VIDEOKONFERENZ! "
start_video_conf2 = "Nichtöffentliche Videokonferenz "
start_video_conf3 = "Nichtöffentliche Videokonferenz- "
start_video_conf1 = re.compile("NICHTÖFFENTLICHE VIDEOKONFERENZ! ", re.I)
start_video_conf2 = re.compile("Nichtöffentliche Videokonferenz ", re.I)
start_video_conf3 = re.compile("Nichtöffentliche Videokonferenz- ", re.I)
abbreviated_name = ""
if name.startswith(start_video_conf1):
if start_video_conf1.match(name):
name = name[len(start_video_conf1):]
if start_video_conf2.match(name):
name = name[len(start_video_conf2):]
if name.startswith(start_video_conf2):
name = name[len(start_video_conf2):]
if name.startswith(start_video_conf3):
if start_video_conf3.match(name):
name = name[len(start_video_conf3):]
if name.startswith(start_plenary):
abbreviated_name = "BV"