Last active
August 29, 2015 14:18
-
-
Save caseysoftware/d34d9e67d07bc815df8d to your computer and use it in GitHub Desktop.
This is used to help students find the most important parts of their class lectures. The full description is here: http://clarify.io/blog/a-study-hint-for-final-exams/
This file contains hidden or 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
| from clarify_python import clarify | |
| clarify.set_key('my api key') | |
| result = clarify.search(query='"on the exam"') | |
| results = result['item_results'] | |
| items = result['_links']['items'] | |
| index = 0 | |
| for item in items: | |
| bundle = clarify.get_bundle(item['href']) | |
| print(bundle['name']) | |
| search_hits = results[index]['term_results'][0]['matches'][0]['hits'] | |
| for search_hit in search_hits: | |
| print(str(search_hit['start']) + ' -- ' + str(search_hit['end'])) | |
| ++index |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment