Skip to content

Commit

Permalink
Checking input is string or list of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Grau Puerto committed Sep 11, 2012
1 parent 76d8791 commit cc4944b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion keywords/keywords.py
Expand Up @@ -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()
Expand Down

0 comments on commit cc4944b

Please sign in to comment.