Commit 38835736 authored by Administrator's avatar Administrator

[FEATURE] Parameter to create whitelist.

parent 7a558551
...@@ -11,7 +11,7 @@ def create_blacklist(user, corpus): ...@@ -11,7 +11,7 @@ def create_blacklist(user, corpus):
def create_synonymes(user, corpus): def create_synonymes(user, corpus):
pass pass
def create_whitelist(user, corpus): def create_whitelist(user, corpus, number=200):
cursor = connection.cursor() cursor = connection.cursor()
try: try:
...@@ -60,16 +60,16 @@ def create_whitelist(user, corpus): ...@@ -60,16 +60,16 @@ def create_whitelist(user, corpus):
ORDER BY ORDER BY
occurrences DESC occurrences DESC
LIMIT LIMIT
100 %d
; ;
""" % (white_list.id, corpus.id, type_document.id) """ % (white_list.id, corpus.id, type_document.id, number)
cursor.execute(query_whitelist) cursor.execute(query_whitelist)
return white_list return white_list
#def create_cooc(user, corpus, whitelist, blacklist, synonymes): #def create_cooc(user, corpus, whitelist, blacklist, synonymes):
def create_cooc(user=None, corpus=None, whitelist=None, size=400): def create_cooc(user=None, corpus=None, whitelist=None, size=600):
cursor = connection.cursor() cursor = connection.cursor()
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment