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
18005304
Commit
18005304
authored
Jan 16, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
b1f5f235
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
doctor_transfer.py
trans2es/utils/doctor_transfer.py
+3
-3
No files found.
trans2es/utils/doctor_transfer.py
View file @
18005304
...
...
@@ -51,7 +51,7 @@ class DoctorTransfer(object):
suggest_type
=
0
if
len
(
ch_name_term
)
!=
len
(
ch_full_word
)
else
1
suggest_item
=
{
"input"
:[
ch_name_term
],
"word_weight"
:(
len
(
ch_name_term
)
/
len
((
ch_full_word
)))
*
prefix_weight
,
"word_weight"
:(
1.0
*
len
(
ch_name_term
)
/
len
((
ch_full_word
)))
*
prefix_weight
,
"suggest_type"
:
suggest_type
}
suggest_list
.
append
(
suggest_item
)
...
...
@@ -65,7 +65,7 @@ class DoctorTransfer(object):
suggest_type
=
2
if
len
(
py_name_term
)
!=
len
(
py_full_word
)
else
3
suggest_item
=
{
"input"
:[
py_name_term
],
"word_weight"
:(
len
(
py_name_term
)
/
len
(
py_full_word
))
*
prefix_weight
,
"word_weight"
:(
1.0
*
len
(
py_name_term
)
/
len
(
py_full_word
))
*
prefix_weight
,
"suggest_type"
:
suggest_type
}
suggest_list
.
append
(
suggest_item
)
...
...
@@ -79,7 +79,7 @@ class DoctorTransfer(object):
suggest_type
=
4
if
len
(
py_acronym_term
)
!=
len
(
py_acronym_full_word
)
else
5
suggest_item
=
{
"input"
:[
py_acronym_term
],
"word_weight"
:(
len
(
py_acronym_term
)
/
len
(
py_acronym_full_word
))
*
prefix_weight
,
"word_weight"
:(
1.0
*
len
(
py_acronym_term
)
/
len
(
py_acronym_full_word
))
*
prefix_weight
,
"suggest_type"
:
suggest_type
}
suggest_list
.
append
(
suggest_item
)
...
...
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