Skip to content

Commit e7f3c73

Browse files
authored
Standardize mazevo building names (#71)
1 parent 9d900b5 commit e7f3c73

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

parser/mazevoParser.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ import (
1111
"github.com/UTDNebula/nebula-api/api/schema"
1212
)
1313

14+
var buildingRenames = map[string]string{
15+
"Student Union": "SU",
16+
"Student Services Addition (SSA)": "SSA",
17+
}
18+
1419
type SourceData struct {
1520
Bookings []map[string]interface{} `json:"bookings"`
1621
}
@@ -54,6 +59,14 @@ func ParseMazevo(inDir string, outDir string) {
5459
continue
5560
}
5661
*building = strings.TrimSpace(*building)
62+
for key, value := range buildingRenames {
63+
if *building == key {
64+
*building = value
65+
}
66+
if strings.HasPrefix(*room, value+" ") {
67+
*room = strings.TrimPrefix(*room, value+" ")
68+
}
69+
}
5770

5871
if _, exists := multiBuildingMap[date]; !exists {
5972
multiBuildingMap[date] = make(map[string]map[string][]schema.MazevoEvent)

0 commit comments

Comments
 (0)