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

"""
database deals with saving, updating and deleting rss items to/from database
"""
# @author chengdujin
# @contact <EMAIL>
# @created Jul., 2013


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

from config.settings import Collection, db
from config.settings import logger

# CONSTANTS
from config.settings import LANGUAGES
<commit_msg>Add comments to doc mongodb index instructions<commit_after>#!/usr/bin/env python
#-*- coding: utf-8 -*-

"""
database deals with saving, updating and deleting rss items to/from database
"""
# @author chengdujin
# @contact <EMAIL>
# @created Jul., 2013


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

from config.settings import Collection, db
from config.settings import logger

# CONSTANTS
from config.settings import LANGUAGES

# Database is indexed by
# db.en.ensureIndex({'feed':1, 'title':1, 'link':1}, {background: true, unique: true, dropDups: true})
# to ensure unique insertion
# and db.en.ensureIndex({'feed':1, 'updated':-1}, {background: true})
# to ensure fast query
#

{'fraction_non_alphanumeric': 0.14073426573426573, 'fraction_numerical': 0.01486013986013986, 'mean_word_length': 4.994764397905759, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4094362', 'n_tokens_mistral': 383, 'n_tokens_neox': 361, 'n_words': 114}