<commit_before># -*- coding: utf-8 -*-
import unittest
import time
import sys

from cwr.parser.decoder.file import default_grammar_factory

"""
Tests for the DefaultFieldFactory.
"""

__author__ = '<NAME>'
__license__ = 'MIT'
__status__ = 'Development'


class TestDefaultRuleFactory(unittest.TestCase):
    def setUp(self):
        self._factory = default_grammar_factory()

    def test_10000(self):
        start = time.clock()
        if sys.version_info[0] == 2:
            for x in xrange(10000):
                self._factory.get_rule('transmission')
        else:
            for x in range(10000):
                self._factory.get_rule('transmission')
        end = time.clock()

        time_parse = (end - start)

        self.assertTrue(time_parse < 1.1)<commit_msg>Changed test time<commit_after># -*- coding: utf-8 -*-
import unittest
import time
import sys

from cwr.parser.decoder.file import default_grammar_factory

"""
Tests for the DefaultFieldFactory.
"""

__author__ = '<NAME>'
__license__ = 'MIT'
__status__ = 'Development'


class TestDefaultRuleFactory(unittest.TestCase):
    def setUp(self):
        self._factory = default_grammar_factory()

    def test_10000(self):
        start = time.clock()
        if sys.version_info[0] == 2:
            for x in xrange(10000):
                self._factory.get_rule('transmission')
        else:
            for x in range(10000):
                self._factory.get_rule('transmission')
        end = time.clock()

        time_parse = (end - start)

        self.assertTrue(time_parse < 2)
{'fraction_non_alphanumeric': 0.11331626120358515, 'fraction_numerical': 0.02496798975672215, 'mean_word_length': 2.6013824884792625, 'pattern_counts': {'":': 0, '<': 7, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '528261', 'n_tokens_mistral': 507, 'n_tokens_neox': 459, 'n_words': 109}