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
alpha
physical
Commits
f4b4fc63
Commit
f4b4fc63
authored
Feb 16, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
4b21c82e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
topic_transfer.py
trans2es/utils/topic_transfer.py
+14
-0
No files found.
trans2es/utils/topic_transfer.py
View file @
f4b4fc63
...
...
@@ -6,6 +6,7 @@ import logging
import
traceback
from
libs.tools
import
tzlc
import
time
import
re
class
TopicTransfer
(
object
):
...
...
@@ -39,8 +40,21 @@ class TopicTransfer(object):
res
[
"offline_score"
]
=
instance
.
get_topic_offline_score
()
res
[
"manual_score"
]
=
instance
.
drop_score
res
[
"has_image"
]
=
instance
.
topic_has_image
()
# 片假名
re_jp_pian_words
=
re
.
compile
(
u"[
\u30a0
-
\u30ff
]+"
)
m_pian
=
re_jp_pian_words
.
search
(
instance
.
content
,
0
)
# 平假名
re_jp_ping_words
=
re
.
compile
(
u"[
\u3040
-
\u309f
]+"
)
m_ping
=
re_jp_ping_words
.
search
(
instance
.
content
,
0
)
if
m_pian
or
m_ping
:
res
[
"language_type"
]
=
10
else
:
res
[
"language_type"
]
=
instance
.
language_type
create_time
=
instance
.
create_time
tzlc_create_time
=
tzlc
(
create_time
)
res
[
"create_time"
]
=
tzlc_create_time
...
...
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