Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
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
钟尚武
physical
Commits
17e344ac
Commit
17e344ac
authored
Dec 27, 2018
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
d05df1be
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
tag_transfer.py
trans2es/utils/tag_transfer.py
+11
-1
No files found.
trans2es/utils/tag_transfer.py
View file @
17e344ac
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
,
absolute_import
,
print_function
import
os
import
sys
import
logging
...
...
@@ -17,7 +19,15 @@ class TagTransfer(object):
res
=
dict
()
res
[
"id"
]
=
instance
.
id
res
[
"suggest"
]
=
instance
.
name
tag_name_terms_list
=
list
()
for
i
in
range
(
len
(
instance
.
name
)):
for
j
in
range
(
i
,
len
(
instance
.
name
)
+
1
):
name_term
=
instance
.
name
[
i
:
j
]
.
strip
()
if
name_term
:
tag_name_terms_list
.
append
(
name_term
)
res
[
"suggest"
]
=
tag_name_terms_list
res
[
"name"
]
=
instance
.
name
res
[
"is_online"
]
=
instance
.
is_online
res
[
"is_deleted"
]
=
instance
.
is_deleted
...
...
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