Permalink
Browse files

Checking input is string or list of strings

  • Loading branch information...
1 parent 76d8791 commit cc4944bc3ce1a170c59662895d00ebe2c667ad26 Sergio Grau Puerto committed Sep 11, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 keywords/keywords.py
View
@@ -17,7 +17,11 @@ def keywords_and_ngrams(input, nKeywords=100, thresholdLL=19, nBigrams=25, thres
fdistText = defaultdict(int)
sumText = 0
listWords = []
-
+ listSentences = []
+ if isinstance(input,str):
+ listSentences = [input]
+ else:
+ listSentences = input
for line in input:
for w in line.split():
w = w.lower()

0 comments on commit cc4944b

Please sign in to comment.