# Path: nmt_chainer/utilities/graph_training.py
# def build_prefix_list(lst, op=max):
# def define_parser(parser):
# def do_graph(args):
# def commandline():
# def none_safe_op(op):
#     def safe_op(x, y):
# def generate_graph(sqldb, dest, title="Training Evolution"):
# 
# Path: nmt_chainer/utilities/replace_tgt_unk.py
# def replace_unk_from_string(translation_str, src_str, dic_fn, remove_unk, normalize_unicode_unk,
#                             attempt_to_relocate_unk_source):
# def replace_unk(translations, src_file, dest, dic_fn, remove_unk, normalize_unicode_unk,
#                 attempt_to_relocate_unk_source):
# def define_parser(parser):
# def do_replace(args):
# def commandline():
# 
# Path: nmt_chainer/utilities/expe_recap.py
# def filenamize(path):
# def process_eval_config(config_fn, dest_dir):
# def process_data_config(config_fn, dest_dir, data_to_train):
# def process_train_config(config_fn, dest_dir):
# def define_parser(parser):
# def do_recap(args):
# def commandline():
# 
# Path: nmt_chainer/utilities/bleu_computer.py
# class BleuComputer(object):
#     def __init__(self):
#     def copy(self):
#     def __repr__(self):
#     def bleu(self):
#     def bleu_plus_alpha(self, alpha=1.0):
#     def update(self, reference, translation):
#     def update_plus(self, diff):
#     def update_minus(self, diff):
#     def compute_ngram_info(sentence):
#     def compute_update_diff_from__infos(reference_info, translation_info):
#     def compute_update_diff(reference, translation):
# def sample_bleu(ref_fn, trans_fn):
# def get_bc_from_files(ref_fn, trans_fn):
# def compute_confidence_interval_from_sampler(bleu_sampler, nb_resampling, confidence_interval=0.95):
# def compute_pairwise_superiority_from_sampler_pair(bleu_sampler, other_bleu_sampler, nb_resampling):
# def define_parser(parser):
# def do_bleu(args):
# def command_line():
# 
# Path: nmt_chainer/utilities/extract_processed_data.py
# def define_parser(parser):
# def do_extract(args):


import argparse
from nmt_chainer.utilities import graph_training
from nmt_chainer.utilities import replace_tgt_unk
from nmt_chainer.utilities import expe_recap
from nmt_chainer.utilities import bleu_computer
from nmt_chainer.utilities import extract_processed_data
from __future__ import absolute_import, division, print_function, unicode_literals

# from nmt_chainer.models import char_encdec

def define_parser(parser):
    subparsers = parser.add_subparsers(dest="__sub_subcommand_name")

    graph_parser = subparsers.add_parser('graph', description="Create a graph of the training data.",
                                         help="Create a graph of the training data.", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    graph_training.define_parser(graph_parser)

    replace_tgt_parser = subparsers.add_parser('replace_tgt_unk', description="Replace UNK tags using a dictionnary.",
                                               help="Replace UNK tags using a dictionnary.", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    replace_tgt_unk.define_parser(replace_tgt_parser)

    recap_parser = subparsers.add_parser('recap', description="Generate recap of experiments.",
                                         help="Generate recap of experimets.", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    expe_recap.define_parser(recap_parser)

    bleu_parser = subparsers.add_parser('bleu', description="Compute BLEU score.",
                                        help="Compute BLEU score.", formatter_class=argparse.ArgumentDefaultsHelpFormatter)

# Path: nmt_chainer/utilities/graph_training.py
# def build_prefix_list(lst, op=max):
# def define_parser(parser):
# def do_graph(args):
# def commandline():
# def none_safe_op(op):
#     def safe_op(x, y):
# def generate_graph(sqldb, dest, title="Training Evolution"):
# 
# Path: nmt_chainer/utilities/replace_tgt_unk.py
# def replace_unk_from_string(translation_str, src_str, dic_fn, remove_unk, normalize_unicode_unk,
#                             attempt_to_relocate_unk_source):
# def replace_unk(translations, src_file, dest, dic_fn, remove_unk, normalize_unicode_unk,
#                 attempt_to_relocate_unk_source):
# def define_parser(parser):
# def do_replace(args):
# def commandline():
# 
# Path: nmt_chainer/utilities/expe_recap.py
# def filenamize(path):
# def process_eval_config(config_fn, dest_dir):
# def process_data_config(config_fn, dest_dir, data_to_train):
# def process_train_config(config_fn, dest_dir):
# def define_parser(parser):
# def do_recap(args):
# def commandline():
# 
# Path: nmt_chainer/utilities/bleu_computer.py
# class BleuComputer(object):
#     def __init__(self):
#     def copy(self):
#     def __repr__(self):
#     def bleu(self):
#     def bleu_plus_alpha(self, alpha=1.0):
#     def update(self, reference, translation):
#     def update_plus(self, diff):
#     def update_minus(self, diff):
#     def compute_ngram_info(sentence):
#     def compute_update_diff_from__infos(reference_info, translation_info):
#     def compute_update_diff(reference, translation):
# def sample_bleu(ref_fn, trans_fn):
# def get_bc_from_files(ref_fn, trans_fn):
# def compute_confidence_interval_from_sampler(bleu_sampler, nb_resampling, confidence_interval=0.95):
# def compute_pairwise_superiority_from_sampler_pair(bleu_sampler, other_bleu_sampler, nb_resampling):
# def define_parser(parser):
# def do_bleu(args):
# def command_line():
# 
# Path: nmt_chainer/utilities/extract_processed_data.py
# def define_parser(parser):
# def do_extract(args):


# Path: nmt_chainer/utilities/utils_command.py
import argparse
from nmt_chainer.utilities import graph_training
from nmt_chainer.utilities import replace_tgt_unk
from nmt_chainer.utilities import expe_recap
from nmt_chainer.utilities import bleu_computer
from nmt_chainer.utilities import extract_processed_data

from __future__ import absolute_import, division, print_function, unicode_literals

# from nmt_chainer.models import char_encdec

def define_parser(parser):
    subparsers = parser.add_subparsers(dest="__sub_subcommand_name")

    graph_parser = subparsers.add_parser('graph', description="Create a graph of the training data.",
                                         help="Create a graph of the training data.", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    graph_training.define_parser(graph_parser)

    replace_tgt_parser = subparsers.add_parser('replace_tgt_unk', description="Replace UNK tags using a dictionnary.",
                                               help="Replace UNK tags using a dictionnary.", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    replace_tgt_unk.define_parser(replace_tgt_parser)

    recap_parser = subparsers.add_parser('recap', description="Generate recap of experiments.",
                                         help="Generate recap of experimets.", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    expe_recap.define_parser(recap_parser)

    bleu_parser = subparsers.add_parser('bleu', description="Compute BLEU score.",
                                        help="Compute BLEU score.", formatter_class=argparse.ArgumentDefaultsHelpFormatter)

    bleu_computer.define_parser(bleu_parser)