Skip to content
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

Merged
merged 11 commits into from
Sep 2, 2020
Merged

Enriched relatedBills JSON #8

merged 11 commits into from
Sep 2, 2020

Conversation

adamwjo
Copy link
Contributor

@adamwjo adamwjo commented Aug 26, 2020

No description provided.

@aih
Copy link
Collaborator

aih commented Sep 1, 2020

@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?

@adamwjo
Copy link
Contributor Author

adamwjo commented Sep 1, 2020

@aih Yup! Working on that now actually. Will have that to you soon

adamwjo and others added 3 commits September 1, 2020 13:45
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):
Copy link
Collaborator

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):
Copy link
Collaborator

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.

@aih aih merged commit eeb71f9 into master Sep 2, 2020
@aih aih deleted the adambranch branch October 20, 2020 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants