Skip to content

Commit

Permalink
method to get threshold name
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgesmr committed Dec 5, 2022
1 parent aa85304 commit d25e8ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion thresholds.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class Threshold(Enum):
NORMAL = 95
STRICT = 98

def get_name(self):
return self.name.lower()

def posts_meeting_criteria(
self, posts: list[ScoredPost], scorer: Scorer
) -> list[ScoredPost]:
Expand All @@ -34,7 +37,7 @@ def posts_meeting_criteria(
def get_thresholds():
"""Returns a dictionary mapping lowercase threshold names to values"""

return {i.name.lower(): i.value for i in Threshold}
return {i.get_name(): i.value for i in Threshold}


def get_threshold_from_name(name: str) -> Threshold:
Expand Down

0 comments on commit d25e8ae

Please sign in to comment.