Filters

Course filtering and ranking module with configurable search weights.

This module provides functionality for filtering and ranking courses based on search queries, using a weighted scoring system for different match types.

Constants

MIN_CHAR_FOR_COS_SIM: int

Minimum characters required in search query before applying cosine similarity matching

DEPARTMENT_NAME_WEIGHT: int

Weight applied to matches found in department names (e.g., 'Computer Science')

COURSE_NAME_WEIGHT: int

Weight applied to matches found in course titles

COURSE_CODE_WEIGHT: int

Weight applied to matches in course codes (e.g., 'COSC-111')

DEPARTMENT_CODE_WEIGHT: int

Weight applied to matches in department codes (e.g., 'COSC')

DIVISION_WEIGHT: int

Weight applied to matches in academic division names (e.g., 'Science')

KEYWORD_WEIGHT: int

Weight applied to matches in course keywords/tags

DESCRIPTION_WEIGHT: int

Weight applied to matches found in course descriptions

PROFESSOR_WEIGHT: int

Weight applied to matches in professor names

HALF_COURSE_WEIGHT: int

Additional weight applied when 'half' appears in query and course is half-credit

SIMILARITY_WEIGHT: int

Multiplier applied to cosine similarity scores for text matching

SCORE_CUTOFF: float

Minimum score threshold as fraction of highest score (0.0 to 1.0) for including a course in results

Functions