Commit ca91e80d authored by 段英荣's avatar 段英荣

modify

parent 2007a2e9
......@@ -15,7 +15,7 @@ from libs.tools import point_distance
def get_suggest_tips(query,lat,lng,offset=0,size=50):
try:
# ios输入法在某些情况下会携带\\u2006
query = query.replace("\\u2006", '')
query = query.replace("\u2006", '')
q = {
"suggest":{
"tips-suggest": {
......
......@@ -62,6 +62,7 @@ def get_tips_suggest_list(instance_cn_name):
suggest_dict[ch_name_term[0]]["suggest_type"] = suggest_item["suggest_type"]
# 拼音
if py_full_word != ch_full_word:
for i in range(len(py_full_word)):
#for j in range(i, len(py_full_word) + 1):
py_name_term = py_full_word[i:].strip()
......@@ -86,6 +87,7 @@ def get_tips_suggest_list(instance_cn_name):
suggest_dict[py_name_term[0]]["suggest_type"] = suggest_item["suggest_type"]
# 简写
if py_acronym_full_word != py_full_word:
for i in range(len(py_acronym_full_word)):
#for j in range(i, len(py_acronym_full_word) + 1):
py_acronym_term = py_acronym_full_word[i:].strip()
......@@ -98,8 +100,7 @@ def get_tips_suggest_list(instance_cn_name):
"input": [py_acronym_term],
"word_weight": (1.0 * len(py_acronym_term) / len(
py_acronym_full_word)) * prefix_weight,
"suggest_type": suggest_type,
"cur_index": cur_index
"suggest_type": suggest_type
}
if py_acronym_term[0] not in suggest_dict:
cur_index += 1
......
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