Добавлен коостяк для подсказок
This commit is contained in:
11
aore/miscutils/trigram.py
Normal file
11
aore/miscutils/trigram.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
def trigram(inp):
|
||||
inp = u"__"+inp+u"__"
|
||||
output = []
|
||||
|
||||
for i in range(0, len(inp) - 2):
|
||||
output.append(inp[i:i + 3])
|
||||
|
||||
return " ".join(output)
|
||||
Reference in New Issue
Block a user