Commit c6a519eaaf663871d6a35e84df0913270c472f83
1 parent
3ab5f2c0
Exists in
master
and in
1 other branch
Created new option 'index_mode', that can be set to '0' (use old index), '10' (r…
…eindex) or '11' (reindex with clustering).
Showing
1 changed file
with
18 additions
and
18 deletions
Show diff stats
src/config.py
| ... | ... | @@ -44,7 +44,7 @@ class Config(): |
| 44 | 44 | self.popcon_index = os.path.expanduser("~/.app-recommender/popcon_index") |
| 45 | 45 | self.popcon_dir = os.path.expanduser("~/.app-recommender/popcon_dir") |
| 46 | 46 | self.clusters_dir = os.path.expanduser("~/.app-recommender/clusters_dir") |
| 47 | - self.clustering = 1 | |
| 47 | + self.index_mode = "0" # use old index | |
| 48 | 48 | self.strategy = "cb" |
| 49 | 49 | self.weight = "bm25" |
| 50 | 50 | self.load_options() |
| ... | ... | @@ -56,23 +56,23 @@ class Config(): |
| 56 | 56 | """ |
| 57 | 57 | print "\n [ general ]" |
| 58 | 58 | print " -h, --help Print this help" |
| 59 | - print " -d, --debug Set logging level to debug." | |
| 60 | - print " -v, --verbose Set logging level to verbose." | |
| 61 | - print " -o, --output=PATH Path to file to save output." | |
| 62 | - print " -c, --config=PATH Path to configuration file." | |
| 59 | + print " -d, --debug Set logging level to debug" | |
| 60 | + print " -v, --verbose Set logging level to verbose" | |
| 61 | + print " -o, --output=PATH Path to file to save output" | |
| 62 | + print " -c, --config=PATH Path to configuration file" | |
| 63 | 63 | print "" |
| 64 | 64 | print " [ recommender ]" |
| 65 | - print " -a, --axi=PATH Path to Apt-xapian-index." | |
| 66 | - print " -p, --popconindex=PATH Path to popcon dedicated index." | |
| 67 | - print " -m, --popcondir=PATH Path to popcon submissions dir." | |
| 68 | - print " -u, --clustering If popcon data should be clustered." | |
| 69 | - print " -l, --clustersdir=PATH Path to popcon clusters dir." | |
| 70 | - print " -w, --weight=OPTION Search weighting scheme." | |
| 71 | - print " -s, --strategy=OPTION Recommendation strategy." | |
| 65 | + print " -a, --axi=PATH Path to Apt-xapian-index" | |
| 66 | + print " -p, --popconindex=PATH Path to popcon dedicated index" | |
| 67 | + print " -m, --popcondir=PATH Path to popcon submissions dir" | |
| 68 | + print " -u, --index_mode= 0: old, 1:reindex, 11:clustered_index" | |
| 69 | + print " -l, --clustersdir=PATH Path to popcon clusters dir" | |
| 70 | + print " -w, --weight=OPTION Search weighting scheme" | |
| 71 | + print " -s, --strategy=OPTION Recommendation strategy" | |
| 72 | 72 | print "" |
| 73 | 73 | print " [ weight options ] " |
| 74 | - print " trad = traditional probabilistic weighting " | |
| 75 | - print " bm25 = bm25 weighting scheme " | |
| 74 | + print " trad = traditional probabilistic weighting" | |
| 75 | + print " bm25 = bm25 weighting scheme" | |
| 76 | 76 | print "" |
| 77 | 77 | print " [ strategy options ] " |
| 78 | 78 | print " cb = content-based " |
| ... | ... | @@ -113,14 +113,14 @@ class Config(): |
| 113 | 113 | self.axi = self.read_option('recommender', 'axi') |
| 114 | 114 | self.popcon_index = self.read_option('recommender', 'popcon_index') |
| 115 | 115 | self.popcon_dir = self.read_option('recommender', 'popcon_dir') |
| 116 | - self.clustering = self.read_option('recommender', 'clustering') | |
| 116 | + self.index_mode = self.read_option('recommender', 'index_mode') | |
| 117 | 117 | self.clusters_dir = self.read_option('recommender', 'clusters_dir') |
| 118 | 118 | self.weight = self.read_option('recommender', 'weight') |
| 119 | 119 | self.strategy = self.read_option('recommender', 'strategy') |
| 120 | 120 | |
| 121 | 121 | short_options = "hdvo:c:a:p:m:ul:w:s:" |
| 122 | 122 | long_options = ["help", "debug", "verbose", "output=", "config=", |
| 123 | - "axi=", "popconindex=", "popcondir=", "clustering", | |
| 123 | + "axi=", "popconindex=", "popcondir=", "index_mode=", | |
| 124 | 124 | "clusters_dir=", "weight=", "strategy="] |
| 125 | 125 | try: |
| 126 | 126 | opts, args = getopt.getopt(sys.argv[1:], short_options, |
| ... | ... | @@ -150,8 +150,8 @@ class Config(): |
| 150 | 150 | self.popcon_index = p |
| 151 | 151 | elif o in ("-m", "--popcondir"): |
| 152 | 152 | self.popcon_dir = p |
| 153 | - elif o in ("-u", "--clustering"): | |
| 154 | - self.clustering = 1 | |
| 153 | + elif o in ("-u", "--index_mode"): | |
| 154 | + self.index_mode = p | |
| 155 | 155 | elif o in ("-l", "--clustersdir"): |
| 156 | 156 | self.clusters_dir = p |
| 157 | 157 | elif o in ("-w", "--weight"): | ... | ... |