Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num_words = 0
- num_diffs = 0
- for line in text:
- new_line = line.split()
- for word in new_line:
- word = clean_up(word)
- num_words += 1
- num_copy = 0
- for other_line in text:
- other_new_line = other_line.split()
- for other_word in other_new_line:
- other_word = clean_up(other_word)
- if other_word == word:
- num_copy += 1
- if num_copy < 2:
- num_diffs += 1
- print num_diffs * 1.0 / num_words
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement