# Path: abkhazia/utils/logger.py
# class LevelFilter(logging.Filter):
# class WhitespaceRemovingFormatter(logging.Formatter):
# class NoEmptyMessageFilter(logging.Filter):
# class NoLocalSubdirNotFound(logging.Filter):
#     def __init__(self, passlevels):
#     def filter(self, record):
#     def format(self, record):
#     def filter(self, record):
#     def filter(self, record):
# def get_log(log_file=os.devnull, verbose=False, header_in_stdout=False):
# def reopen_files(log, mode='a+'):
# def null_logger():
# 
# Path: abkhazia/utils/config.py
# class AbkhaziaConfig(object):
#     def default_config_file(name='abkhazia'):
#     def __init__(self, config_file=None):


import configparser
import random
from abkhazia.utils import logger, config


class CorpusSplit(object):
    """A class for spliting an abkhazia corpus into train and test subsets

    corpus : The abkhazia corpus to split. The corpus is assumed
      to be valid.

    log : a logging.Logger instance to send log messages

    random_seed : Seed for pseudo-random numbers generation (default
      is to use the current system time)

    prune : If True the train and testing corpora are pruned (default is True)

    In the split and split_by_speakers methods, arguments are as follow:

        test_prop : float, should be between 0.0 and 1.0 and
          represent the proportion of the dataset to include in the
          test split. If None, the value is automatically set to the
          complement of the train size. If train size is also None,
          test size is set to 0.5. (default is None)

        train_prop : float, should be between 0.0 and 1.0 and
          represent the proportion of the dataset to include in the
          train split. If None, the value is automatically set to the
          complement of the test size. (default is None)


    """

# Path: abkhazia/utils/logger.py
# class LevelFilter(logging.Filter):
# class WhitespaceRemovingFormatter(logging.Formatter):
# class NoEmptyMessageFilter(logging.Filter):
# class NoLocalSubdirNotFound(logging.Filter):
#     def __init__(self, passlevels):
#     def filter(self, record):
#     def format(self, record):
#     def filter(self, record):
#     def filter(self, record):
# def get_log(log_file=os.devnull, verbose=False, header_in_stdout=False):
# def reopen_files(log, mode='a+'):
# def null_logger():
# 
# Path: abkhazia/utils/config.py
# class AbkhaziaConfig(object):
#     def default_config_file(name='abkhazia'):
#     def __init__(self, config_file=None):


# Path: abkhazia/corpus/corpus_split.py
import configparser
import random
from abkhazia.utils import logger, config



class CorpusSplit(object):
    """A class for spliting an abkhazia corpus into train and test subsets

    corpus : The abkhazia corpus to split. The corpus is assumed
      to be valid.

    log : a logging.Logger instance to send log messages

    random_seed : Seed for pseudo-random numbers generation (default
      is to use the current system time)

    prune : If True the train and testing corpora are pruned (default is True)

    In the split and split_by_speakers methods, arguments are as follow:

        test_prop : float, should be between 0.0 and 1.0 and
          represent the proportion of the dataset to include in the
          test split. If None, the value is automatically set to the
          complement of the train size. If train size is also None,
          test size is set to 0.5. (default is None)

        train_prop : float, should be between 0.0 and 1.0 and
          represent the proportion of the dataset to include in the
          train split. If None, the value is automatically set to the
          complement of the test size. (default is None)


    """

    def __init__(self, corpus, log=logger.null_logger(),