Commit f364ac09 by Frank Wiles

Actually use the stem

parent cf5df6c9
...@@ -7,11 +7,15 @@ from django.conf import settings ...@@ -7,11 +7,15 @@ from django.conf import settings
def _suggest_keywords(content=None): def _suggest_keywords(content=None):
""" Suggest by keywords """ """ Suggest by keywords """
suggested_keywords = set() suggested_keywords = set()
keywords = TagKeyword.objects.values_list('keyword', 'tag') keywords = TagKeyword.objects.values_list('keyword', 'stem', 'tag')
for k in keywords: for k in keywords:
if k[0] in content: # Use the stem if available, otherwise use the whole keyword
suggested_keywords.add(k[1]) if k[1]:
if k[1] in content:
suggested_keywords.add(k[2])
elif k[0] in content:
suggested_keywords.add(k[2])
return suggested_keywords return suggested_keywords
......
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 sign in to comment