-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enriched relatedBills JSON #8
Conversation
@adamwjo, did you want to document (here?) the remaining changes you'd like to make for relatedBills.py? Does it collect all of the 'same titles' you expect? |
@aih Yup! Working on that now actually. Will have that to you soon |
Were these the types of changes you had in mind? Happy to add/delete!
else: | ||
for item in similarList: | ||
item.get('titles').append(title) | ||
def main(args, loglevel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added back the 'main' function to run from command-line. Takes output and saves to a file for easy inspection afterward.
@@ -36,38 +36,68 @@ def loadTitlesIndex(titleIndexPath=PATH_TO_TITLES_INDEX, zip=True): | |||
|
|||
return titlesIndex | |||
|
|||
def getSimilarTitles(titlesIndex: dict, same=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this function above the function (getRelatedBills) that calls it. Reorganized this to 1) create the billsRelatedByTitle dictionary from scratch in one pass. 2) Within the inner loop, get the index of the similar bill in the list, if it already exists. If it doesn't, add it to the list. If it does, append the current title to that bill's list of 'titles'. 2) add a 'same' Boolean parameter for when we want to match titles that are almost the same, but not exactly.
No description provided.