Commit f4b4fc63 authored by 段英荣's avatar 段英荣

modify

parent 4b21c82e
...@@ -6,6 +6,7 @@ import logging ...@@ -6,6 +6,7 @@ import logging
import traceback import traceback
from libs.tools import tzlc from libs.tools import tzlc
import time import time
import re
class TopicTransfer(object): class TopicTransfer(object):
...@@ -39,7 +40,20 @@ class TopicTransfer(object): ...@@ -39,7 +40,20 @@ class TopicTransfer(object):
res["offline_score"] = instance.get_topic_offline_score() res["offline_score"] = instance.get_topic_offline_score()
res["manual_score"] = instance.drop_score res["manual_score"] = instance.drop_score
res["has_image"] = instance.topic_has_image() res["has_image"] = instance.topic_has_image()
res["language_type"] = instance.language_type
# 片假名
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 create_time = instance.create_time
tzlc_create_time = tzlc(create_time) tzlc_create_time = tzlc(create_time)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment