Skip to content

Commit 3744e9d

Browse files
committed
Fixed PEP8
1 parent 29bbf91 commit 3744e9d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pythainlp/lm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
"remove_repeated_ngrams"
99
]
1010

11-
from pythainlp.lm.text_util import calculate_ngram_counts,remove_repeated_ngrams
11+
from pythainlp.lm.text_util import calculate_ngram_counts, remove_repeated_ngrams

pythainlp/lm/text_util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
def calculate_ngram_counts(
1111
list_words: List[str],
12-
n_min: int=2,
13-
n_max: int=4)-> Dict[Tuple[str], int]:
12+
n_min: int = 2,
13+
n_max: int = 4)-> Dict[Tuple[str], int]:
1414
"""
1515
Calculates the counts of n-grams in the list words for the specified range.
1616
@@ -26,7 +26,7 @@ def calculate_ngram_counts(
2626

2727
for n in range(n_min, n_max + 1):
2828
for i in range(len(list_words) - n + 1):
29-
ngram = tuple(list_words[i:i+n])
29+
ngram = tuple(list_words[i:i + n])
3030
ngram_counts[ngram] = ngram_counts.get(ngram, 0) + 1
3131

3232
return ngram_counts

0 commit comments

Comments
 (0)