From bcffff20519cce55a0fb3573dc4c583019f69bde Mon Sep 17 00:00:00 2001 From: Sysroot Date: Wed, 17 Jan 2024 22:02:31 -0600 Subject: [PATCH] Fix name error --- go.mod | 2 +- go.sum | 4 ++-- parser/professorParser.go | 6 +++--- parser/sectionParser.go | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 21aebc0..320f3c7 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/UTDNebula/nebula-api/api v0.0.0-20231204040332-adccdc08b203 - github.com/chromedp/cdproto v0.0.0-20231101223124-24f5925b5980 + github.com/chromedp/cdproto v0.0.0-20240116100315-4a0ec5e4c400 github.com/chromedp/chromedp v0.9.3 github.com/joho/godotenv v1.5.1 go.mongodb.org/mongo-driver v1.13.0 diff --git a/go.sum b/go.sum index 2e65c0d..f0a3c5c 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/UTDNebula/nebula-api/api v0.0.0-20231204040332-adccdc08b203/go.mod h1 github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= github.com/chromedp/cdproto v0.0.0-20231011050154-1d073bb38998/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= -github.com/chromedp/cdproto v0.0.0-20231101223124-24f5925b5980 h1:/nOO3ctHFqUmUwK5EdItjTCRQQCTcxWU7aJgyjFGtEc= -github.com/chromedp/cdproto v0.0.0-20231101223124-24f5925b5980/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= +github.com/chromedp/cdproto v0.0.0-20240116100315-4a0ec5e4c400 h1:mHR3reslmE6J351eW8TgB/BPT+B9OzMxLe7dPa5WYSQ= +github.com/chromedp/cdproto v0.0.0-20240116100315-4a0ec5e4c400/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= github.com/chromedp/chromedp v0.9.3 h1:Wq58e0dZOdHsxaj9Owmfcf+ibtpYN1N0FWVbaxa/esg= github.com/chromedp/chromedp v0.9.3/go.mod h1:NipeUkUcuzIdFbBP8eNNvl9upcceOfWzoJn6cRe4ksA= github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic= diff --git a/parser/professorParser.go b/parser/professorParser.go index 34ad0af..8ab5a30 100644 --- a/parser/professorParser.go +++ b/parser/professorParser.go @@ -13,7 +13,7 @@ func parseProfessors(sectionId schema.IdWrapper, rowInfo map[string]string, clas var profRefs []schema.IdWrapper = make([]schema.IdWrapper, 0, len(professorMatches)) for _, match := range professorMatches { - nameStr := trimWhitespace(match[1]) + nameStr := TrimWhitespace(match[1]) names := strings.Split(nameStr, " ") firstName := strings.Join(names[:len(names)-1], " ") @@ -37,8 +37,8 @@ func parseProfessors(sectionId schema.IdWrapper, rowInfo map[string]string, clas prof.Id = schema.IdWrapper(primitive.NewObjectID().Hex()) prof.First_name = firstName prof.Last_name = lastName - prof.Titles = []string{trimWhitespace(match[2])} - prof.Email = trimWhitespace(match[3]) + prof.Titles = []string{TrimWhitespace(match[2])} + prof.Email = TrimWhitespace(match[3]) prof.Sections = []schema.IdWrapper{sectionId} profRefs = append(profRefs, prof.Id) Professors[profKey] = prof diff --git a/parser/sectionParser.go b/parser/sectionParser.go index 49c27c0..153c050 100644 --- a/parser/sectionParser.go +++ b/parser/sectionParser.go @@ -38,12 +38,12 @@ func parseSection(courseRef *schema.Course, classNum string, syllabusURI string, section.Teaching_assistants = make([]schema.Assistant, 0, len(assistantMatches)) for _, match := range assistantMatches { assistant := schema.Assistant{} - nameStr := trimWhitespace(match[1]) + nameStr := TrimWhitespace(match[1]) names := strings.Split(nameStr, " ") assistant.First_name = strings.Join(names[:len(names)-1], " ") assistant.Last_name = names[len(names)-1] - assistant.Role = trimWhitespace(match[2]) - assistant.Email = trimWhitespace(match[3]) + assistant.Role = TrimWhitespace(match[2]) + assistant.Email = TrimWhitespace(match[3]) section.Teaching_assistants = append(section.Teaching_assistants, assistant) }