# Path: wordseg/utils.py
# def str2type(t):
# def type2str(t):
# def strip(string):
# def null_logger():
# def get_logger(name=None, level=logging.WARNING):
#     def __init__(self, elements):
#     def __iter__(self):
#     def __next__(self):
#     def __init__(self, function):
#     def __call__(self):
#     def exit(msg):
# def get_binary(binary):
# def get_config_files(algorithm, extension=None):
#     def __init__(self, short_name=None, name=None, type=None,
#                  default=None, help=''):
#     def add_to_parser(self, parser):
#     def parsed_name(self):
# def get_parser(description=None, separator=Separator(), train_file=False):
# def prepare_main(name=None,
#                  description=None,
#                  separator=Separator(phone=None, syllable=None, word=None),
#                  add_arguments=None,
#                  train_file=False):
# class CountingIterator:
# class CatchExceptions:
# class Argument:


import codecs
import collections
import datetime
import gzip
import logging
import os
import random
import re
import shlex
import shutil
import subprocess
import tempfile
import threading
import joblib
from wordseg import utils
# gold file we do not want to expose here. An alternative (still to
# code) is to have something like "for i in 1..5 do wordseg-ag |
# wordseg-eval done > extract_median_result""
#






# -----------------------------------------------------------------------------
#  Adaptor Grammar arguments
# -----------------------------------------------------------------------------


AG_ARGUMENTS = [
    utils.Argument(
        short_name='-d', name='--debug', type=int, default=100,
        help='debugging level, regulates the amount of debug messages, '
        'to be used in conjuction with -vv'),

    utils.Argument(
        short_name='-x', name='--eval-every', type=int,
        help='estimates parse trees every <int> iterations'),

    utils.Argument(
        short_name='-u', name='--test-file', type='file', default=None,
        help=('test strings to be parsed (but not trained on) '
              'every eval-every iterations, default is to test on input')),


# Path: wordseg/utils.py
# def str2type(t):
# def type2str(t):
# def strip(string):
# def null_logger():
# def get_logger(name=None, level=logging.WARNING):
#     def __init__(self, elements):
#     def __iter__(self):
#     def __next__(self):
#     def __init__(self, function):
#     def __call__(self):
#     def exit(msg):
# def get_binary(binary):
# def get_config_files(algorithm, extension=None):
#     def __init__(self, short_name=None, name=None, type=None,
#                  default=None, help=''):
#     def add_to_parser(self, parser):
#     def parsed_name(self):
# def get_parser(description=None, separator=Separator(), train_file=False):
# def prepare_main(name=None,
#                  description=None,
#                  separator=Separator(phone=None, syllable=None, word=None),
#                  add_arguments=None,
#                  train_file=False):
# class CountingIterator:
# class CatchExceptions:
# class Argument:


# Path: wordseg/algos/ag.py
import codecs
import collections
import datetime
import gzip
import logging
import os
import random
import re
import shlex
import shutil
import subprocess
import tempfile
import threading
import joblib
from wordseg import utils

# gold file we do not want to expose here. An alternative (still to
# code) is to have something like "for i in 1..5 do wordseg-ag |
# wordseg-eval done > extract_median_result""
#






# -----------------------------------------------------------------------------
#  Adaptor Grammar arguments
# -----------------------------------------------------------------------------


AG_ARGUMENTS = [
    utils.Argument(
        short_name='-d', name='--debug', type=int, default=100,
        help='debugging level, regulates the amount of debug messages, '
        'to be used in conjuction with -vv'),

    utils.Argument(
        short_name='-x', name='--eval-every', type=int,
        help='estimates parse trees every <int> iterations'),

    utils.Argument(
        short_name='-u', name='--test-file', type='file', default=None,
        help=('test strings to be parsed (but not trained on) '
              'every eval-every iterations, default is to test on input')),


    utils.Argument(