Skip to content

Instantly share code, notes, and snippets.



Created Mar 10, 2019
What would you like to do?
def fn_vector(words):
import re, locale
#global words
def slug(words):
return fn_slug(words)
i = 0
dic = {}
words = slug(words)
for word in re.split('\s+', words):
i = i + 1; # position
c = [i];
if (word in dic):
c = dic[word]
dic[word] = c
arr = []
for word, c in dic.items():
c = ','.join(map(str, c))
arr.append('%s:%s' % (word, c))
locale.setlocale(locale.LC_COLLATE, 'tr_TR.UTF-8')
return ' '.join(arr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.