parser

package
v0.0.0-...-8fd0174 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ANDRegex = regexp.MustCompile(`(?i)\s+and\s+`)
View Source
var CourseIDMap = make(map[schema.IdWrapper]string)

Auxilliary dictionaries for mapping the generated ObjectIDs to the keys used in the above maps, used for validation purposes

View Source
var Courses = make(map[string]*schema.Course)
View Source
var GradeMap map[string]map[string][]int

Grade mappings for section grade distributions, mapping is MAP[SEMESTER] -> MAP[SUBJECT + NUMBER + SECTION] -> GRADE DISTRIBUTION

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+`)
View Source
var ProfessorIDMap = make(map[schema.IdWrapper]string)
View Source
var Professors = make(map[string]*schema.Professor)
View Source
var ReqParsers = make(map[schema.IdWrapper]func())

Requisite parser closures associated with courses

Main dictionaries for mapping unique keys to the actual data

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)

Externally exposed parse function

func SubstitutionMatcher

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

func ThrowawayMatcher

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

Types

type Matcher

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

Regex matcher object for requisite group parsing

Jump to

Keyboard shortcuts

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