allow for single term topics
This commit is contained in:
parent
7acc3bc9e6
commit
46c6761680
|
@ -38,7 +38,11 @@ def get_topics_dict():
|
||||||
return {}
|
return {}
|
||||||
topics = {}
|
topics = {}
|
||||||
for line in settings.topics.splitlines():
|
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())
|
topics[id] = (term, normalizer.normalize(term).lower())
|
||||||
return topics
|
return topics
|
||||||
|
|
||||||
|
|
Reference in New Issue