-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add WritingGoal class - add WG<=>TT mapping to constants; - add test to make sure we can get the WGs correctly from the TTs; - add WG column to master CSV. * Update readme with writing goal info
- Loading branch information
Showing
5 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from typing import List | ||
from elements import ToneTag | ||
from constants import * | ||
|
||
|
||
class WritingGoal: | ||
# This constructor isn't needed for now tbh | ||
def __init__(self, name: str): | ||
self.name = name | ||
self.tags = WRITING_GOAL_MAPPING[name] | ||
|
||
@staticmethod | ||
# From a list of tone tags, return all the writing goals serviced by that tag | ||
def list_from_tags(tags: List[ToneTag]): | ||
goals = [] | ||
for tag in tags: | ||
for goal, tag_list in WRITING_GOAL_MAPPING.items(): | ||
if tag.tag in tag_list and goal not in goals: | ||
goals.append(goal) | ||
return goals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters