Skip to content

Instantly share code, notes, and snippets.

@igor-shevchenko
igor-shevchenko / textrank.py
Created June 20, 2013 08:34
TextRank algorithm for text summarization.
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)))
// 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