Skip to content
Browse files

Merge branch 'speaking' of github.com:Swizec/botko into speaking

  • Loading branch information...
2 parents f1eba87 + 3a0d7cc commit 82094db0c8afd27951a81c9cf99e829cc24dbf40 @Swizec committed Apr 25, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/Corpus.py
View
3 src/Corpus.py
@@ -1,4 +1,3 @@
-
from itertools import *
import random
import UserDict
@@ -11,7 +10,7 @@ def pairwise(iterable):
def ngrams(text, l):
text = text.split(" ")
- return [text[i:i+1] for i in xrange(len(text)-1) if len(text[i:i+1]) > 0]
+ return [text[i:i+l] for i in xrange(len(text)-l) if len(text[i:i+l]) > 0]
class Corpus(UserDict.IterableUserDict):
ngram_len = 1

0 comments on commit 82094db

Please sign in to comment.
Something went wrong with that request. Please try again.