Commit a326400b authored by 李小芳's avatar 李小芳

Merge branch 'change' into 'master'

add

See merge request !86
parents 4ebc8099 4646c05e
......@@ -47,7 +47,7 @@ def get_tips_suggest_list(instance_cn_name):
term_begin_prefix_weight = begin_prefix_weight if i == 0 else 1.0
suggest_item = {
"input": [ch_name_term],
"word_weight": (1.0 * len(ch_name_term) / len(
"word_weight": 100 + (1.0 * len(ch_name_term) / len(
(ch_full_word))) * prefix_weight * term_begin_prefix_weight,
"suggest_type": suggest_type
}
......@@ -70,7 +70,7 @@ def get_tips_suggest_list(instance_cn_name):
term_begin_prefix_weight = begin_prefix_weight if i == 0 else 1.0
suggest_item = {
"input": [py_name_term],
"word_weight": (1.0 * len(py_name_term) / len(
"word_weight": 100 + (1.0 * len(py_name_term) / len(
py_full_word)) * prefix_weight * term_begin_prefix_weight,
"suggest_type": suggest_type
}
......@@ -96,7 +96,7 @@ def get_tips_suggest_list(instance_cn_name):
term_begin_prefix_weight = begin_prefix_weight if i == 0 else 1.0
suggest_item = {
"input": [py_acronym_term],
"word_weight": (1.0 * len(py_acronym_term) / len(
"word_weight": 100 + (1.0 * len(py_acronym_term) / len(
py_acronym_full_word)) * prefix_weight * term_begin_prefix_weight,
"suggest_type": suggest_type
}
......@@ -107,7 +107,7 @@ def get_tips_suggest_list(instance_cn_name):
else:
suggest_dict[py_acronym_term[0]]["input"].append(py_acronym_term)
if suggest_item["word_weight"] > suggest_dict[py_acronym_term[0]]["word_weight"]:
suggest_dict[py_acronym_term[0]]["word_weight"] = 100+ int(suggest_item["word_weight"])
suggest_dict[py_acronym_term[0]]["word_weight"] = 100 + int(suggest_item["word_weight"])
suggest_dict[py_acronym_term[0]]["suggest_type"] = suggest_item["suggest_type"]
return suggest_dict.values()
......
......@@ -145,7 +145,6 @@ class TypeInfo(object):
instance.name = instance.keyword
resemble_list = WordResemble.get_word_resemble_list(str(instance.name))
for suggest_item in suggest_list:
suggest_dict = copy.deepcopy(item_dict)
suggest_dict["suggest_type"] = suggest_item["suggest_type"]
......
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