Skip to content

Instantly share code, notes, and snippets.

View originalankur's full-sized avatar
🖥️
Coding underway.

Ankur Gupta originalankur

🖥️
Coding underway.
  • Bengaluru, India
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pip install networkx distance pattern
In Flipboard's article[1], they kindly divulge their interpretation
of the summarization technique called LexRank[2].
def normalize_line(line):
return [piece.strip() for piece in line.split("|")[1:-1]]
def is_valid_line(line):
return "|" in line
def load(text):
lines = map(normalize_line,
filter(is_valid_line,
text.strip().splitlines()))