# Path: linguistica/util.py
# ENCODING = 'utf8'
# 
# PARAMETERS = {'max_word_tokens': 0,  # zero means all word tokens
#               'min_stem_length': 4,
#               'max_affix_length': 4,
#               'min_sig_count': 5,
#               # 'min_affix_length': 1,
#               # 'min_sf_pf_count': 3,
#               'n_neighbors': 9,
#               'n_eigenvectors': 11,
#               'min_context_count': 3,
#               'max_word_types': 1000,
#               'suffixing': 1,  # 1 means yes, 0 means no
#               'keep_case': 0,  # 1 means yes, 0 means no
#               }


import sys
import os
import linguistica as lxa
from pprint import pformat
from six.moves import input
from linguistica.util import (ENCODING, PARAMETERS)
def get_output_dir(output_dir_):
    change_dir_response = None
    while change_dir_response is None:
        change_dir_response = input('Change it? [N/y] ')

    if change_dir_response and change_dir_response[0].lower() == 'y':
        new_output_dir = None
        while new_output_dir is None:
            new_output_dir = input('Specify output directory: ')

            if sys.platform.startswith('win'):
                new_output_dir = new_output_dir.replace('/', os.sep)
            else:
                new_output_dir = new_output_dir.replace('\\', os.sep)

            new_output_dir = os.path.abspath(new_output_dir)

            if not os.path.isdir(new_output_dir):
                try:
                    os.mkdir(new_output_dir)
                except FileNotFoundError:
                    print('Cannot make a new directory in a non-existing one!')
                    new_output_dir = None

        output_dir_ = new_output_dir

    return output_dir_


def get_encoding():

# Path: linguistica/util.py
# ENCODING = 'utf8'
# 
# PARAMETERS = {'max_word_tokens': 0,  # zero means all word tokens
#               'min_stem_length': 4,
#               'max_affix_length': 4,
#               'min_sig_count': 5,
#               # 'min_affix_length': 1,
#               # 'min_sf_pf_count': 3,
#               'n_neighbors': 9,
#               'n_eigenvectors': 11,
#               'min_context_count': 3,
#               'max_word_types': 1000,
#               'suffixing': 1,  # 1 means yes, 0 means no
#               'keep_case': 0,  # 1 means yes, 0 means no
#               }


# Path: linguistica/cli.py
import sys
import os
import linguistica as lxa
from pprint import pformat
from six.moves import input
from linguistica.util import (ENCODING, PARAMETERS)

def get_output_dir(output_dir_):
    change_dir_response = None
    while change_dir_response is None:
        change_dir_response = input('Change it? [N/y] ')

    if change_dir_response and change_dir_response[0].lower() == 'y':
        new_output_dir = None
        while new_output_dir is None:
            new_output_dir = input('Specify output directory: ')

            if sys.platform.startswith('win'):
                new_output_dir = new_output_dir.replace('/', os.sep)
            else:
                new_output_dir = new_output_dir.replace('\\', os.sep)

            new_output_dir = os.path.abspath(new_output_dir)

            if not os.path.isdir(new_output_dir):
                try:
                    os.mkdir(new_output_dir)
                except FileNotFoundError:
                    print('Cannot make a new directory in a non-existing one!')
                    new_output_dir = None

        output_dir_ = new_output_dir

    return output_dir_


def get_encoding():

    encoding = ENCODING