allow for single term topics

This commit is contained in:
Frédéric Péters 2011-11-20 20:58:44 +01:00
parent 7acc3bc9e6
commit 46c6761680
1 changed files with 5 additions and 1 deletions

View File

@ -38,7 +38,11 @@ def get_topics_dict():
return {}
topics = {}
for line in settings.topics.splitlines():
id, term = line.strip().split('|')
if line.count('|') == 1:
id, term = line.strip().split('|')
else:
term = line.strip()
id = term.encode('ascii', 'replace')
topics[id] = (term, normalizer.normalize(term).lower())
return topics