80 likes | 98 Views
What is a Literary Fingerprint?. http://www.physorg.com/news179651371.html http://iopscience.iop.org/1367-2630/11/12/123015 What are some of the issues in creating 'fingerprint' Where else do fingerprints occur? What is www.shazam.com What is www.tineye.com
E N D
What is a Literary Fingerprint? • http://www.physorg.com/news179651371.html • http://iopscience.iop.org/1367-2630/11/12/123015 • What are some of the issues in creating 'fingerprint' • Where else do fingerprints occur? • What is www.shazam.com • What is www.tineye.com • How do we go from sets to frequency analysis? • Toward understanding Python dictionary data type
How do you read words from file? • I exist solely as the CanisFamiliaris 'Bassett' • I ain't nothin' but a hound-dog
Six of one and half-a-dozen … def wordsFromFile3(filename): file = open(filename) words = [] for line in file: for w in line.split(): words.append(w) file.close() return words • Change one line to get all words in lowercase equivalent • See CommonWords.py
Six of one and half-a-dozen … def wordsFromFile2(filename): file = open(filename) words = [] for line in file: words.extend(line.split()) file.close() return words • Change one line to get all words in lowercase equivalent • See CommonWords.py
Six of one and half-a-dozen … def wordsFromFile(filename): file = open(filename) words = file.read().split() file.close() return words • Change one line to get all words in lowercase equivalent • See CommonWords.py • Reasoning about common words
How do we find 'common words' • Should common words be included in our literary fingerprint? • Where do authoritative sources originate? Determinable? • How can we experiment and compare common files? • Using Python sets! • Words in one set that aren't in another? • How do we do this in Python? • How do we find words in all sets? • Is intersection an associative operation? Do we care?
Set Operations from pictures • http://en.wikipedia.org/wiki/File:Venn0111.svg
APTs for practice: great minds … • Membercheck and SimpleWordGame • Set idioms • List comprehensions • Understandable code • Why do we study more than one way to …? • Expressive power • Neuronal excitement • Creating connections • We don't have to