Permalink
Browse files

tweaks

  • Loading branch information...
ralsina committed May 24, 2017
1 parent 967c6fc commit eb279cba8b9d437965e296b1e3a490512d85fe60
Showing with 4 additions and 7 deletions.
  1. +4 −7 v7/similarity/similarity.py
@@ -52,7 +52,6 @@ def gen_tasks(self):
"output_folder": self.site.config["OUTPUT_FOLDER"],
}
stopwords = {}
for l in self.site.translations:
stopwords[l] = get_stop_words(l)
@@ -61,8 +60,6 @@ def split_text(text, lang="en"):
words = text.lower().split()
return [w for w in words if w not in stopwords[lang]]
texts = []
yield self.group_task()
def tags_similarity(p1, p2):
@@ -121,9 +118,8 @@ def write_similar(path, p, lang, indexes=indexes, dictionaries=dictionaries, lsi
json.dump(data, outf)
for lang in self.site.translations:
file_dep = []
for p in self.site.timeline:
file_dep.append(p.translated_source_path(lang))
file_dep = [p.translated_source_path(lang) for p in self.site.timeline]
uptodate = utils.config_changed({1: kw}, 'similarity')
for i, post in enumerate(self.site.timeline):
out_name = os.path.join(kw['output_folder'], post.destination_path(lang=lang)) + '.related.json'
task = {
@@ -132,6 +128,7 @@ def write_similar(path, p, lang, indexes=indexes, dictionaries=dictionaries, lsi
'targets': [out_name],
'actions': [(write_similar, (out_name, post, lang))],
'file_dep': file_dep,
'uptodate': [utils.config_changed({1: kw}, 'similarity')],
'uptodate': [uptodate],
'clean': True,
}
yield task

0 comments on commit eb279cb

Please sign in to comment.