diff --git a/gensim/parsing/preprocessing.py b/gensim/parsing/preprocessing.py index 1280f242dd..367f0b02ad 100644 --- a/gensim/parsing/preprocessing.py +++ b/gensim/parsing/preprocessing.py @@ -1,3 +1,8 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html + import re import string import glob diff --git a/gensim/summarization/commons.py b/gensim/summarization/commons.py index 341cb16041..1c467098f9 100644 --- a/gensim/summarization/commons.py +++ b/gensim/summarization/commons.py @@ -1,3 +1,7 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from gensim.summarization.graph import Graph diff --git a/gensim/summarization/graph.py b/gensim/summarization/graph.py index 51183ffb61..bfed410b5e 100644 --- a/gensim/summarization/graph.py +++ b/gensim/summarization/graph.py @@ -1,8 +1,12 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from abc import ABCMeta, abstractmethod -class IGraph: +class IGraph(object): """ Represents the interface or contract that the graph for TextRank should implement. """ @@ -18,7 +22,6 @@ def nodes(self): """ pass - @abstractmethod def edges(self): """ @@ -42,7 +45,6 @@ def neighbors(self, node): """ pass - @abstractmethod def has_node(self, node): """ @@ -56,7 +58,6 @@ def has_node(self, node): """ pass - @abstractmethod def add_node(self, node, attrs=None): """ @@ -75,7 +76,6 @@ def add_node(self, node, attrs=None): """ pass - @abstractmethod def add_edge(self, edge, wt=1, label='', attrs=[]): """ @@ -98,7 +98,6 @@ def add_edge(self, edge, wt=1, label='', attrs=[]): """ pass - @abstractmethod def has_edge(self, edge): """ @@ -112,7 +111,6 @@ def has_edge(self, edge): """ pass - @abstractmethod def edge_weight(self, edge): """ @@ -126,7 +124,6 @@ def edge_weight(self, edge): """ pass - @abstractmethod def del_node(self, node): """ diff --git a/gensim/summarization/keywords.py b/gensim/summarization/keywords.py index 4c7bab90c1..d09bdff7a7 100644 --- a/gensim/summarization/keywords.py +++ b/gensim/summarization/keywords.py @@ -1,3 +1,7 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from gensim.summarization.pagerank_weighted import pagerank_weighted_scipy as _pagerank from gensim.summarization.textcleaner import clean_text_by_word as _clean_text_by_word diff --git a/gensim/summarization/pagerank_weighted.py b/gensim/summarization/pagerank_weighted.py index 86e59d6de8..82a7524bcc 100644 --- a/gensim/summarization/pagerank_weighted.py +++ b/gensim/summarization/pagerank_weighted.py @@ -1,3 +1,7 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from numpy import empty as empty_matrix from scipy.sparse import csr_matrix diff --git a/gensim/summarization/summarizer.py b/gensim/summarization/summarizer.py index 1530783a55..7f6dc1fd9e 100644 --- a/gensim/summarization/summarizer.py +++ b/gensim/summarization/summarizer.py @@ -1,3 +1,7 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from gensim.summarization.pagerank_weighted import pagerank_weighted_scipy as _pagerank from gensim.summarization.textcleaner import clean_text_by_sentences as _clean_text_by_sentences diff --git a/gensim/summarization/syntactic_unit.py b/gensim/summarization/syntactic_unit.py index 3355388643..89842e1122 100644 --- a/gensim/summarization/syntactic_unit.py +++ b/gensim/summarization/syntactic_unit.py @@ -1,3 +1,8 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html + class SyntacticUnit(object): diff --git a/gensim/summarization/textcleaner.py b/gensim/summarization/textcleaner.py index 2caac86b48..00a3d682cf 100644 --- a/gensim/summarization/textcleaner.py +++ b/gensim/summarization/textcleaner.py @@ -1,3 +1,7 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from gensim.summarization.syntactic_unit import SyntacticUnit from gensim.parsing.preprocessing import preprocess_documents @@ -98,7 +102,7 @@ def clean_text_by_word(text): original_words = list(tokenize(text_without_acronyms, to_lower=True, deacc=True)) filtered_words = [join_words(word_list, "") for word_list in preprocess_documents(original_words)] if HAS_PATTERN: - tags = tag(join_words(original_words)) # tag needs the context of the words in the text + tags = tag(join_words(original_words)) # tag needs the context of the words in the text else: tags = None units = merge_syntactic_units(original_words, filtered_words, tags)