parser

package
v0.0.0-...-098ed8e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Sections dictionary for mapping UUIDs to a *schema.Section
	Sections = make(map[primitive.ObjectID]*schema.Section)

	// Courses dictionary for keys (Internal_course_number +  Catalog_year) to a *schema.Course
	Courses = make(map[string]*schema.Course)

	// Professors dictionary for keys (First_name +   Last_name) to a *schema.Professor
	Professors = make(map[string]*schema.Professor)

	//CourseIDMap auxiliary dictionary for mapping UUIDs to a *schema.Course
	CourseIDMap = make(map[primitive.ObjectID]string)

	//ProfessorIDMap auxiliary dictionary for mapping UUIDs to a *schema.Professor
	ProfessorIDMap = make(map[primitive.ObjectID]string)

	// ReqParsers dictionary mapping course UUIDs to the func() that parsers its Reqs
	ReqParsers = make(map[primitive.ObjectID]func())

	// GradeMap mappings for section grade distributions, mapping is MAP[SEMESTER] -> MAP[SUBJECT + NUMBER + SECTION] -> GRADE DISTRIBUTION
	GradeMap map[string]map[string][]int
)
View Source
var ANDRegex = regexp.MustCompile(`(?i)\s+and\s+`)
View Source
var Matchers []Matcher

Matcher container, matchers must be in order of precedence NOTE: PARENTHESES ARE OF HIGHEST PRECEDENCE! (This is due to groupParens() handling grouping of parenthesized text before parsing begins)

View Source
var ORRegex = regexp.MustCompile(`(?i)\s+or\s+`)

Functions

func ANDMatcher

func ANDMatcher(group string, subgroups []string) interface{}

func ChoiceMatcher

func ChoiceMatcher(group string, subgroups []string) interface{}

func ConsentMatcher

func ConsentMatcher(group string, subgroups []string) interface{}

func CoreCompletionMatcher

func CoreCompletionMatcher(group string, subgroups []string) interface{}

func CoreMatcher

func CoreMatcher(group string, subgroups []string) interface{}

func CourseMatcher

func CourseMatcher(group string, subgroups []string) interface{}

func CourseMinGradeMatcher

func CourseMinGradeMatcher(group string, subgroups []string) interface{}

func GPAMatcher

func GPAMatcher(group string, subgroups []string) interface{}

func GroupTagMatcher

func GroupTagMatcher(group string, subgroups []string) interface{}

func LimitMatcher

func LimitMatcher(group string, subgroups []string) interface{}

func MajorMatcher

func MajorMatcher(group string, subgroups []string) interface{}

func MajorMinorMatcher

func MajorMinorMatcher(group string, subgroups []string) interface{}

func MinorMatcher

func MinorMatcher(group string, subgroups []string) interface{}

func ORMatcher

func ORMatcher(group string, subgroups []string) interface{}

func OtherMatcher

func OtherMatcher(group string, subgroups []string) interface{}

func Parse

func Parse(inDir string, outDir string, csvPath string, skipValidation bool)

Parse Externally exposed parse function

func ParseAstra

func ParseAstra(inDir string, outDir string)

func ParseMazevo

func ParseMazevo(inDir string, outDir string)

func SubstitutionMatcher

func SubstitutionMatcher(parseFnc func(string, []string) interface{}) func(string, []string) interface{}

func ThrowawayMatcher

func ThrowawayMatcher(group string, subgroups []string) interface{}

Types

type InputData

type InputData struct {
	Fields string          `json:"fields"`
	Data   [][]interface{} `json:"data"`
}

type Matcher

type Matcher struct {
	Regex   *regexp.Regexp
	Handler func(string, []string) interface{}
}

Regex matcher object for requisite group parsing

type SourceData

type SourceData struct {
	Bookings []map[string]interface{} `json:"bookings"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL