예제 #1
0
 def _build_keyword_dictionaries(self):
     result = utils.get_documents_for_collection('newsarticlekeywords')
     for i in result:
         word = i['word']
         score = i['score']
         self.keywords_by_word[word] = score
         if self.keywords_by_score.get(score, ''):
             self.keywords_by_score[score].append(word)
         else:
             self.keywords_by_score[score] = [word]
예제 #2
0
def get_source_urls():
    article_sources = utils.get_documents_for_collection('newssourceconfigs')
    return [a['url'] for a in article_sources]