Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
@@ -154,14 +154,8 @@ def googleSearch(
|
|
154 |
|
155 |
def getQueries(text, n):
|
156 |
# return n-grams of size n
|
157 |
-
finalq = []
|
158 |
words = text.split()
|
159 |
-
|
160 |
-
|
161 |
-
for i in range(0, l - n + 1):
|
162 |
-
finalq.append(words[i : i + n])
|
163 |
-
|
164 |
-
return finalq
|
165 |
|
166 |
|
167 |
def print2D(array):
|
|
|
154 |
|
155 |
def getQueries(text, n):
|
156 |
# return n-grams of size n
|
|
|
157 |
words = text.split()
|
158 |
+
return [words[i : i + n] for i in range(len(words) - n + 1)]
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
|
161 |
def print2D(array):
|