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

"""
.. codeauthor:: <NAME> <<EMAIL>>
"""

from __future__ import absolute_import

from ._extractor import (
    TableSchemaExtractorV0,
    TableSchemaExtractorV1,
    TableSchemaExtractorV2,
    TableSchemaExtractorV3,
    TableSchemaExtractorV4,
    TableSchemaExtractorV5
)
from ._interface import TableSchemaExtractorInterface


class TableSchemaExtractorFactory(object):

    __EXTRACTOR_MAPPING = {
        0: TableSchemaExtractorV0,
        1: TableSchemaExtractorV1,
        2: TableSchemaExtractorV2,
        3: TableSchemaExtractorV3,
        4: TableSchemaExtractorV4,
        5: TableSchemaExtractorV5,
    }

    def __init__(self, database_path):
        self.__database_path = database_path

    def create(self, verbosity_level):

        return self.__EXTRACTOR_MAPPING.get(
            verbosity_level,
            self.__EXTRACTOR_MAPPING[max(self.__EXTRACTOR_MAPPING)]
        )(self.__database_path)<commit_msg>Add max_verbosity_level property to extractor factory<commit_after>#!/usr/bin/env python
# encoding: utf-8

"""
.. codeauthor:: <NAME> <<EMAIL>>
"""

from __future__ import absolute_import

from ._extractor import (
    TableSchemaExtractorV0,
    TableSchemaExtractorV1,
    TableSchemaExtractorV2,
    TableSchemaExtractorV3,
    TableSchemaExtractorV4,
    TableSchemaExtractorV5
)
from ._interface import TableSchemaExtractorInterface


class TableSchemaExtractorFactory(object):

    __EXTRACTOR_MAPPING = {
        0: TableSchemaExtractorV0,
        1: TableSchemaExtractorV1,
        2: TableSchemaExtractorV2,
        3: TableSchemaExtractorV3,
        4: TableSchemaExtractorV4,
        5: TableSchemaExtractorV5,
    }

    @property
    def max_verbosity_level(self):
        return self.__EXTRACTOR_MAPPING[max(self.__EXTRACTOR_MAPPING)]

    def __init__(self, database_path):
        self.__database_path = database_path

    def create(self, verbosity_level):

        return self.__EXTRACTOR_MAPPING.get(
            verbosity_level,
            self.max_verbosity_level
        )(self.__database_path)
{'fraction_non_alphanumeric': 0.07644824311490978, 'fraction_numerical': 0.018043684710351376, 'mean_word_length': 3.4925373134328357, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5286345', 'n_tokens_mistral': 676, 'n_tokens_neox': 651, 'n_words': 113}