From d82ad12f1014291fe3db4b4b1e9eb364f68c211d Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Mon, 15 Nov 2021 22:37:46 -0600 Subject: Filter out McAllen sections --- src/util/parser.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/util') diff --git a/src/util/parser.ts b/src/util/parser.ts index 2f1bdd4..7f2a8b1 100644 --- a/src/util/parser.ts +++ b/src/util/parser.ts @@ -20,6 +20,9 @@ interface LabSchedule { tuesday: boolean, wednesday: boolean } + }[], + sectionAttributes: { + description: string }[] }[] }; @@ -57,7 +60,7 @@ interface DatabaseFile { */ export function parsePTSchedule(schedule: string) { // namePatter: - const namePattern = /^(.*)\s(.*)\s(\d{9})/; + const namePattern = /^(.*?)\s(.*)\s(\d{9})/; // eventPattern (24hr time): MTWRF hh:mm - hh:mm const eventPattern = /^(M?T?W?R?F?)\s(\d{1,2}:\d{2})\s?-\s?(\d{1,2}:\d{2})/; const lines = schedule.split("\n").filter(line => line.trim()); @@ -94,7 +97,7 @@ export function parseLabSchedule(schedule: LabSchedule) { const courses = schedule.data; for(const course of courses) { - if(!taughtCourses.includes(course.courseNumber)) { + if(!taughtCourses.includes(course.courseNumber) || course.sectionAttributes[0].description === "McAllen") { continue; } -- cgit v1.2.3