Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion utils/recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def score_single_project(

Returns an integer score (0 means no match at all).
"""
# Compare time availability, return results with the same time availibity or lower.
TIME_AVAILABILITY = ['low', 'medium', 'high']
time_availability_index = TIME_AVAILABILITY.index(time_availability.strip().lower())
valid_time = TIME_AVAILABILITY[ : time_availability_index + 1 ]

score = 0

# Compare user's skills against the project's required skills
Expand All @@ -88,7 +93,9 @@ def score_single_project(
if project.get("time", "").lower() == time_availability.lower():
score += SCORING_WEIGHTS["time"]

return score
if project.get("time", "").lower() in valid_time :
return score
return 0


def get_recommendations(skills_string, level, interest, time_availability):
Expand Down
Loading