<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
config.py contains most CONSTANTS in the project
"""
# @author chengdujin
# @contact <EMAIL>
# @created Jan 17, 2013


import sys
reload(sys)
sys.setdefaultencoding('UTF-8')

# SERVICES
from pymongo.connection import Connection
from pymongo.database import Database
from pymongo.collection import Collection
from pymongo.errors import CollectionInvalid
con = Connection('127.0.0.1:27017')
db = Database(con, 'news')

import redis
#rclient = redis.StrictRedis(host='10.240.35.40', port=6379)
rclient = redis.StrictRedis(host='127.0.0.1')


# CONSTANTS
#PUBLIC = 'http://mobile-global.baidu.com/news/%s'
PUBLIC = 'http://180.76.2.34/%s'
#LOCAL = '/home/work/STATIC/%s'
LOCAL = '/home/jinyuan/Downloads/%s'

TRANSCODED_LOCAL_DIR = LOCAL % 'news/ts/'
TRANSCODED_PUBLIC_DIR = PUBLIC % 'ts/'

IMAGES_LOCAL_DIR = LOCAL % 'news/img/'
IMAGES_PUBLIC_DIR = PUBLIC % 'img/'

MEDIA_LOCAL_DIR = LOCAL % 'news/mid/'
MEDIA_PUBLIC_DIR = PUBLIC % 'mid/'

NEWS_TEMPLATE = LOCAL % 'news/templates/index.html'
NEWS_TEMPLATE_ARABIC = LOCAL % 'news/templates/index_arabic.html'
UCK_TRANSCODING = 'http://gate.baidu.com/tc?m=8&from=bdpc_browser&src='
TRANSCODED_ENCODING = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>\n'

TRANSCODING_BTN_EN = 'Original page'
TRANSCODING_BTN_PT = 'Página original'
TRANSCODING_BTN_JA = '元のページ'
TRANSCODING_BTN_IND = 'Laman Asli'
TRANSCODING_BTN_TH = 'หน้าเดิม'
TRANSCODING_BTN_AR = 'ﺎﻠﻤﺻﺩﺭ'
TRANSCODING_BTN_ZH_CN = '查看原始网页'
TRANSCODING_BTN_ZH_HK = '查看原始鏈接'

DATABASE_REMOVAL_DAYS = 90
MEMORY_RESTORATION_DAYS = 20
MEMORY_EXPIRATION_DAYS = 20

STRATEGY_WITHOUT_WEIGHTS = 1
STRATEGY_WITH_WEIGHTS = 2

FEED_REGISTRAR = 'feeds'

PARAGRAPH_CRITERIA = 40
SUMMARY_LENGTH_LIMIT = 500
UCK_TIMEOUT = 15  # 15 seconds timeout
GOOGLE_TTS_TIMEOUT = 10

LANGUAGES = ['en', 'th', 'ind', 'ja', 'pt', 'en-rIN', 'ar', 'zh-CN', 'zh-HK']
MIN_IMAGE_SIZE = 150, 150
THUMBNAIL_STYLE = 1.4
THUMBNAIL_LANDSCAPE_SIZE_HIGH = 600, 226
THUMBNAIL_LANDSCAPE_SIZE_NORMAL = 450, 169
THUMBNAIL_LANDSCAPE_SIZE_LOW = 230, 85<commit_msg>changed google tts timeout to 15 seconds<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
config.py contains most CONSTANTS in the project
"""
# @author chengdujin
# @contact <EMAIL>
# @created Jan 17, 2013


import sys
reload(sys)
sys.setdefaultencoding('UTF-8')

# SERVICES
from pymongo.connection import Connection
from pymongo.database import Database
from pymongo.collection import Collection
from pymongo.errors import CollectionInvalid
con = Connection('127.0.0.1:27017')
db = Database(con, 'news')

import redis
#rclient = redis.StrictRedis(host='10.240.35.40', port=6379)
rclient = redis.StrictRedis(host='127.0.0.1')


# CONSTANTS
#PUBLIC = 'http://mobile-global.baidu.com/news/%s'
PUBLIC = 'http://172.16.31.10/%s'
#LOCAL = '/home/work/STATIC/%s'
LOCAL = '/home/jinyuan/Downloads/%s'

TRANSCODED_LOCAL_DIR = LOCAL % 'news/ts/'
TRANSCODED_PUBLIC_DIR = PUBLIC % 'ts/'

IMAGES_LOCAL_DIR = LOCAL % 'news/img/'
IMAGES_PUBLIC_DIR = PUBLIC % 'img/'

MEDIA_LOCAL_DIR = LOCAL % 'news/mid/'
MEDIA_PUBLIC_DIR = PUBLIC % 'mid/'

NEWS_TEMPLATE = LOCAL % 'news/templates/index.html'
NEWS_TEMPLATE_ARABIC = LOCAL % 'news/templates/index_arabic.html'
UCK_TRANSCODING = 'http://gate.baidu.com/tc?m=8&from=bdpc_browser&src='
TRANSCODED_ENCODING = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>\n'

TRANSCODING_BTN_EN = 'Original page'
TRANSCODING_BTN_PT = 'Página original'
TRANSCODING_BTN_JA = '元のページ'
TRANSCODING_BTN_IND = 'Laman Asli'
TRANSCODING_BTN_TH = 'หน้าเดิม'
TRANSCODING_BTN_AR = 'ﺎﻠﻤﺻﺩﺭ'
TRANSCODING_BTN_ZH_CN = '查看原始网页'
TRANSCODING_BTN_ZH_HK = '查看原始鏈接'

DATABASE_REMOVAL_DAYS = 90
MEMORY_RESTORATION_DAYS = 20
MEMORY_EXPIRATION_DAYS = 20

STRATEGY_WITHOUT_WEIGHTS = 1
STRATEGY_WITH_WEIGHTS = 2

FEED_REGISTRAR = 'feeds'

PARAGRAPH_CRITERIA = 40
SUMMARY_LENGTH_LIMIT = 500
UCK_TIMEOUT = 15  # 15 seconds timeout
GOOGLE_TTS_TIMEOUT = 15

LANGUAGES = ['en', 'th', 'ind', 'ja', 'pt', 'en-rIN', 'ar', 'zh-CN', 'zh-HK']
MIN_IMAGE_SIZE = 150, 150
THUMBNAIL_STYLE = 1.4
THUMBNAIL_LANDSCAPE_SIZE_HIGH = 600, 226
THUMBNAIL_LANDSCAPE_SIZE_NORMAL = 450, 169
THUMBNAIL_LANDSCAPE_SIZE_LOW = 230, 85
{'fraction_non_alphanumeric': 0.13649289099526066, 'fraction_numerical': 0.044312796208530805, 'mean_word_length': 5.689381933438986, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '278866', 'n_tokens_mistral': 2023, 'n_tokens_neox': 1797, 'n_words': 319}