Lines 86-92
Link Here
|
86 |
if (id == -2) continue; |
86 |
if (id == -2) continue; |
87 |
if (id != -1) { |
87 |
if (id != -1) { |
88 |
if (userule) |
88 |
if (userule) |
89 |
rules.insert (std::make_pair <std::string, double> (item, alpha[id])); |
89 |
rules.insert (std::make_pair(item, alpha[id])); |
90 |
result.push_back (id); |
90 |
result.push_back (id); |
91 |
} |
91 |
} |
92 |
project (item, size+1, newdepth, l, new_trie_pos, new_str_pos); |
92 |
project (item, size+1, newdepth, l, new_trie_pos, new_str_pos); |
Lines 138-144
Link Here
|
138 |
if (id == -2) continue; |
138 |
if (id == -2) continue; |
139 |
if (id >= 0) { |
139 |
if (id >= 0) { |
140 |
if (userule) |
140 |
if (userule) |
141 |
rules.insert (std::make_pair <std::string, double> (tree[i].val.key(), alpha[id])); |
141 |
rules.insert (std::make_pair(tree[i].val.key(), alpha[id])); |
142 |
result.push_back (id); |
142 |
result.push_back (id); |
143 |
} |
143 |
} |
144 |
project (tree[i].val.key(), 1, 0, i, 0, 0); |
144 |
project (tree[i].val.key(), 1, 0, i, 0, 0); |
Lines 158-164
Link Here
|
158 |
|
158 |
|
159 |
for (std::map <std::string, double>::iterator it = rules.begin(); |
159 |
for (std::map <std::string, double>::iterator it = rules.begin(); |
160 |
it != rules.end(); ++it) |
160 |
it != rules.end(); ++it) |
161 |
tmp.push_back (std::make_pair <std::string, double> (it->first, it->second)); |
161 |
tmp.push_back (std::make_pair(it->first, it->second)); |
162 |
|
162 |
|
163 |
std::sort (tmp.begin(), tmp.end(), pair_2nd_cmp<std::string, double>()); |
163 |
std::sort (tmp.begin(), tmp.end(), pair_2nd_cmp<std::string, double>()); |
164 |
|
164 |
|