Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
search_tips
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
search_tips
Commits
a326400b
Commit
a326400b
authored
Apr 29, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'change' into 'master'
add See merge request
!86
parents
4ebc8099
4646c05e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
commons.py
trans2es/commons/commons.py
+4
-4
type_info.py
trans2es/type_info.py
+0
-1
No files found.
trans2es/commons/commons.py
View file @
a326400b
...
...
@@ -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
()
...
...
trans2es/type_info.py
View file @
a326400b
...
...
@@ -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"
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment