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
a6d68011
Commit
a6d68011
authored
Feb 18, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
485c13ca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
words_utils.py
trans2es/commons/words_utils.py
+6
-2
itemwiki_transfer.py
trans2es/utils/itemwiki_transfer.py
+1
-0
No files found.
trans2es/commons/words_utils.py
View file @
a6d68011
...
...
@@ -208,15 +208,19 @@ class QueryWordAttr(object):
have_save_order_weight
=
json_data
.
get
(
'order_weight'
,
0
)
have_save_search_num
=
json_data
.
get
(
'order_weight'
,
0
)
logging
.
info
(
"query:
%
s,have_save_order_weight:
%
s,have_save_search_num:
%
s,order_weight:
%
s,search_num:
%
s"
%
(
query
,
have_save_order_weight
,
have_save_search_num
,
order_weight
,
search_num
))
if
get_ret
:
if
have_save_order_weight
=
=
order_weight
and
have_save_search_num
==
search_num
:
if
have_save_order_weight
>
=
order_weight
and
have_save_search_num
==
search_num
:
return
True
else
:
return
False
else
:
if
have_save_order_weight
<
order_weight
or
(
have_save_order_weight
==
order_weight
and
have_save_search_num
<
search_num
):
logging
.
log
(
logging
.
info
(
"query:
%
s,have_save_order_weight:
%
s,have_save_search_num:
%
s,order_weight:
%
s,search_num:
%
s"
%
(
query
,
have_save_order_weight
,
have_save_search_num
,
order_weight
,
search_num
))
...
...
trans2es/utils/itemwiki_transfer.py
View file @
a6d68011
...
...
@@ -87,6 +87,7 @@ class ItemWikiTransfer(object):
item_dict
=
dict
()
suggest_list
=
list
()
ret_bol
=
QueryWordAttr
.
save_query_to_redis
(
query
=
str
(
instance
.
name
),
from_type
=
"wiki"
,
get_ret
=
True
)
logging
.
info
(
"get_wiki_query:
%
s,ret_bol:
%
s"
%
(
instance
.
name
,
ret_bol
))
if
ret_bol
:
item_dict
[
"id"
]
=
getMd5Digest
(
str
(
instance
.
name
))
item_dict
[
"ori_name"
]
=
instance
.
name
...
...
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