Skip to content

Commit

Permalink
Fix name error
Browse files Browse the repository at this point in the history
  • Loading branch information
jpahm committed Jan 18, 2024
1 parent e06596e commit bcffff2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 3 additions & 3 deletions parser/professorParser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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], " ")
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions parser/sectionParser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit bcffff2

Please sign in to comment.