# 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 math
import os
import re
from wordseg import utils
    group.add_argument(
        '-t', '--threshold', type=str,
        choices=['relative', 'absolute'], default='relative',
        help='''Use a relative or absolute threshold for boundary decisions on
        transition probabilities. When absolute, the threshold is set
        to the mean transition probability over the entire text.
        Default is relative.''')

    group1 = group.add_mutually_exclusive_group()
    group1.add_argument(
        '-d', '--dependency', type=str,
        choices=['ftp', 'btp', 'mi'], default='ftp',
        help='''Dependency measure to use. ftp is forward transitional probability:
        ftp(XY) = freq(XY) / freq(X), btp is backward transitional
        probability: ftp(XY) = freq(XY) / freq(Y), mi is mutual
        information: mi(XY) = log2( freq(XY) / (freq(X) * freq(Y))).
        ''')

    group1.add_argument(
        '-p', '--probability', type=str, choices=['forward', 'backward'],
        help='''DEPRECATED, USE -d/--dependency INSTEAD. Compute forward or
        backward transitional probabilities. Equivalent to -d ftp / -d
        btp respectively.''')


@utils.CatchExceptions
def main():
    """Entry point of the 'wordseg-tp' command"""
    # command initialization


# 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/tp.py
import codecs
import collections
import math
import os
import re
from wordseg import utils

    group.add_argument(
        '-t', '--threshold', type=str,
        choices=['relative', 'absolute'], default='relative',
        help='''Use a relative or absolute threshold for boundary decisions on
        transition probabilities. When absolute, the threshold is set
        to the mean transition probability over the entire text.
        Default is relative.''')

    group1 = group.add_mutually_exclusive_group()
    group1.add_argument(
        '-d', '--dependency', type=str,
        choices=['ftp', 'btp', 'mi'], default='ftp',
        help='''Dependency measure to use. ftp is forward transitional probability:
        ftp(XY) = freq(XY) / freq(X), btp is backward transitional
        probability: ftp(XY) = freq(XY) / freq(Y), mi is mutual
        information: mi(XY) = log2( freq(XY) / (freq(X) * freq(Y))).
        ''')

    group1.add_argument(
        '-p', '--probability', type=str, choices=['forward', 'backward'],
        help='''DEPRECATED, USE -d/--dependency INSTEAD. Compute forward or
        backward transitional probabilities. Equivalent to -d ftp / -d
        btp respectively.''')


@utils.CatchExceptions
def main():
    """Entry point of the 'wordseg-tp' command"""
    # command initialization


    streamin, streamout, _, log, args = utils.prepare_main(