Commit 21833ebd authored by Lucas Moura's avatar Lucas Moura

Merge tag 'upstream/0.6.2.3'

Upstream version 0.6.2.3

# gpg: Signature made Fri 08 Jul 2016 10:13:07 AM BRT using RSA key ID 2DA5B48C
# gpg: Good signature from "Lucas Albuquerque Medeiros de Moura <lucas.moura128@gmail.com>"
parents 06468379 3d30bd13
......@@ -101,7 +101,7 @@ def collect_popcon_submission():
create_popularity_contest_file()
popcon = subprocess.Popen('./popularity-contest',
shell=True, stdin=subprocess.PIPE,
shell=False, stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
......
......@@ -114,28 +114,26 @@ class Recommender:
Set initial parameters.
"""
self.cfg = Config()
# Load xapian indexes
# self.axi_programs = xapian.Database(cfg.axi_programs)
self.axi_desktopapps = xapian.Database(self.cfg.axi_desktopapps)
if self.cfg.popcon:
# self.popcon_programs = xapian.Database(cfg.popcon_programs)
self.popcon_desktopapps = xapian.Database(
self.cfg.popcon_desktopapps)
# Load valid programs, desktopapps and tags
# format: one package or tag name per line
# self.valid_programs = []
self.valid_desktopapps = []
self.valid_tags = []
logging.info("Loading recommender filters")
# with open(os.path.join(cfg.filters_dir,"programs")) as pkgs:
# self.valid_programs = [line.strip() for line in pkgs
# if not line.startswith("#")]
with open(os.path.join(self.cfg.filters_dir, "desktopapps")) as pkgs:
self.valid_desktopapps = [line.strip() for line in pkgs
if not line.startswith("#")]
with open(os.path.join(self.cfg.filters_dir, "debtags")) as tags:
self.valid_tags = [line.strip() for line in tags
if not line.startswith("#")]
# Set xapian index weighting scheme
if self.cfg.weight == "bm25":
self.weight = xapian.BM25Weight(self.cfg.bm25_k1, self.cfg.bm25_k2,
......@@ -143,6 +141,7 @@ class Recommender:
self.cfg.bm25_nl)
else:
self.weight = xapian.TradWeight()
self.set_strategy(self.cfg.strategy)
def set_strategy(self, strategy_str, n=0):
......
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 to comment