nathanhleung / grades.natecation.xyz

📊 Website with UCLA grade distributions from 2021-2023
https://grades.natecation.xyz
5 stars 4 forks source link

Improve departmental search results for multi-word queries #14

Open TomBinford opened 10 months ago

TomBinford commented 10 months ago

Some queries that could work better than they do: "poli sci" should match POL SCI (Political Science) but currently gives 0 results

"bio chem" should match BIOL CH (Biological Chemistry) but currently gives 0 results Ideally "biochem" would also match BIOL CH where it currently only matches CHEM; that might have to be hardcoded like "cs" -> "com sci" is.

"chem e" should match CH ENGR (Chemical Engineering) but currently gives 0 results

"mech e" should match MECH&AE (Mechanical and Aerospace Engineering) but currently gives 0 results

christopherm99 commented 10 months ago

This is as simple as using a fuzzy search instead of an exact match search. Using a tool like https://github.com/farzher/fuzzysort would also even close #10.