예제 #1
0
COMMENT_MIN_WORDS = getattr(settings, 'ZINNIA_COMMENT_MIN_WORDS', 4)

COMMENT_FLAG_USER_ID = getattr(settings, 'ZINNIA_COMMENT_FLAG_USER_ID', 1)

UPLOAD_TO = getattr(settings, 'ZINNIA_UPLOAD_TO', 'uploads/zinnia')

PROTOCOL = getattr(settings, 'ZINNIA_PROTOCOL', 'http')

FEEDS_FORMAT = getattr(settings, 'ZINNIA_FEEDS_FORMAT', 'rss')
FEEDS_MAX_ITEMS = getattr(settings, 'ZINNIA_FEEDS_MAX_ITEMS', 15)

PINGBACK_CONTENT_LENGTH = getattr(settings,
                                  'ZINNIA_PINGBACK_CONTENT_LENGTH', 300)

SEARCH_FIELDS = getattr(settings, 'ZINNIA_SEARCH_FIELDS',
                        ['title', 'lead', 'content',
                         'excerpt', 'image_caption', 'tags'])

COMPARISON_FIELDS = getattr(settings, 'ZINNIA_COMPARISON_FIELDS',
                            ['title', 'lead', 'content',
                             'excerpt', 'image_caption', 'tags'])

SPAM_CHECKER_BACKENDS = getattr(settings, 'ZINNIA_SPAM_CHECKER_BACKENDS',
                                [])

URL_SHORTENER_BACKEND = getattr(settings, 'ZINNIA_URL_SHORTENER_BACKEND',
                                'zinnia.url_shortener.backends.default')

STOP_WORDS = stop_words(settings.LANGUAGE_CODE.split('-')[0])
def removeEnglishStopWords():
    """
    deletion of common english words (default)
    """
    englishStopWords = stop_words('en')
    return englishStopWords.rebase(getAllTweets(), '')
예제 #3
0
 def setUp(self):
     english_stop_words = stop_words('english')
     self.original_stop_words = comparison.STOP_WORDS
     comparison.STOP_WORDS = english_stop_words
     disconnect_entry_signals()
예제 #4
0
COMMENT_MIN_WORDS = getattr(settings, 'ZINNIA_COMMENT_MIN_WORDS', 4)

COMMENT_FLAG_USER_ID = getattr(settings, 'ZINNIA_COMMENT_FLAG_USER_ID', 1)

UPLOAD_TO = getattr(settings, 'ZINNIA_UPLOAD_TO', 'uploads/zinnia')

PROTOCOL = getattr(settings, 'ZINNIA_PROTOCOL', 'http')

FEEDS_FORMAT = getattr(settings, 'ZINNIA_FEEDS_FORMAT', 'rss')
FEEDS_MAX_ITEMS = getattr(settings, 'ZINNIA_FEEDS_MAX_ITEMS', 15)

PINGBACK_CONTENT_LENGTH = getattr(settings,
                                  'ZINNIA_PINGBACK_CONTENT_LENGTH', 300)

SEARCH_FIELDS = getattr(settings, 'ZINNIA_SEARCH_FIELDS',
                        ['title', 'lead', 'content',
                         'excerpt', 'image_caption', 'tags'])

COMPARISON_FIELDS = getattr(settings, 'ZINNIA_COMPARISON_FIELDS',
                            ['title', 'lead', 'content',
                             'excerpt', 'image_caption', 'tags'])

SPAM_CHECKER_BACKENDS = getattr(settings, 'ZINNIA_SPAM_CHECKER_BACKENDS',
                                [])

URL_SHORTENER_BACKEND = getattr(settings, 'ZINNIA_URL_SHORTENER_BACKEND',
                                'zinnia.url_shortener.backends.default')

STOP_WORDS = stop_words(settings.LANGUAGE_CODE.split('-')[0])
 def setUp(self):
     english_stop_words = stop_words('english')
     self.original_stop_words = comparison.STOP_WORDS
     comparison.STOP_WORDS = english_stop_words
     disconnect_entry_signals()
예제 #6
0
 def test_stop_words(self):
     self.assertTrue(isinstance(stop_words('french'), StopWord))
     self.assertTrue(isinstance(stop_words('klingon'), StopWord))
     self.assertRaises(StopWordError, stop_words, 'klingon', False)
예제 #7
0
 def test_stop_words(self):
     self.assertTrue(isinstance(stop_words('french'), StopWord))
     self.assertTrue(isinstance(stop_words('klingon'), StopWord))
     self.assertRaises(StopWordError, stop_words, 'klingon', False)