This file contains 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
// Hosey_warnings.xcconfig | |
// see http://boredzo.org/blog/archives/2009-11-07/warnings | |
// http://rentzsch.tumblr.com/post/237349423/hoseyifyxcodewarnings-scpt | |
// http://tewha.net/2010/11/xcode-warnings/ | |
GCC_TREAT_WARNINGS_AS_ERRORS = YES | |
GCC_WARN_64_TO_32_BIT_CONVERSION = YES | |
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES | |
GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES | |
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES |
This file contains 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 itertools import combinations | |
from nltk.tokenize import sent_tokenize, RegexpTokenizer | |
from nltk.stem.snowball import RussianStemmer | |
import networkx as nx | |
def similarity(s1, s2): | |
if not len(s1) or not len(s2): | |
return 0.0 | |
return len(s1.intersection(s2))/(1.0 * (len(s1) + len(s2))) |