# settings that define randomized decisions of printers (currently only LaTeX printer)
from sympy.util import RandomDecidedTruthValue, RandomDecidedChoice, RandomChoice, RandomTruthValue

randomize_settings = {
    "fold_frac_powers": RandomDecidedTruthValue(),
    "fold_func_brackets": RandomDecidedTruthValue(),
    "fold_short_frac": RandomTruthValue(),
    "inv_trig_style": RandomDecidedChoice(["abbreviated", 'full', 'power']),
    "ln_notation": RandomDecidedTruthValue(probability_true=0.8),
    "long_frac_ratio": RandomChoice([0, 1, 2]),
    "mat_delim": RandomDecidedChoice(["[", "("]),
    "mode": RandomDecidedChoice(["plain"]),
    "mul_symbol": RandomDecidedChoice([None, "dot", "*", 'blank', r'times'], weigths=[3, 10, 3, 1, 1]),
    "mul_symbol_numbers": RandomDecidedChoice(['dot', '*']),
    "pow2_as_mul": RandomTruthValue(probability_true=0.2),
    "pow3_as_pow2_mul": RandomTruthValue(probability_true=0.1),
    "pow3_as_mul": RandomTruthValue(probability_true=0.1),
    "symbol_names": {"pm": "\\pm", "Var": "Var", 'dots': RandomChoice(["\\dots", "..."])},
    "root_notation": RandomDecidedTruthValue(0.7),
    "imaginary_unit": RandomDecidedChoice(["i", "j", "ri", "ti"], weigths=[5, 1, 5, 2]),
    "gothic_re_im": RandomDecidedTruthValue(),
    "diff_operator": RandomDecidedChoice(["d", "rd", "td"], weigths=[5, 5, 1]),
    "diff_force_wrt": RandomTruthValue(probability_true=0.3),
    "max_prime": RandomChoice([2, 3, 4]),
    "wrt": RandomChoice(["\\frac{%s}{%s}", "%s/%s"], weights=[1, 3]),
    "matrix": RandomChoice(["pmatrix", "array", 'simple'], weights=[10, 4, 2]),
    "array_side": RandomDecidedChoice(['l', 'r', 'c', 'random'], weigths=[3, 3, 20, 1]),
    "plus_minus": RandomDecidedChoice(["\\pm", "+-", "±"], weigths=[8, 1, 2]),
    "expected_value": RandomDecidedChoice(["\\operatorname{E}", "\\mathbb{E}", "E"], weigths=[1, 10, 4]),
    "variance": RandomDecidedChoice(["\\operatorname{Var}", "\\mathbb{Var}", "Var", "VAR"], weigths=[1, 10, 4, 1]),
    "covariance": RandomDecidedChoice(["\\operatorname{Cov}", "\\mathbb{Cov}", "Cov", "COV"], weigths=[1, 10, 4, 1]),
    "probability": RandomDecidedChoice(["\\operatorname{P}", "\\mathbb{P}", "P"], weigths=[1, 10, 4]),
    "function_brackets": RandomDecidedChoice(["%s[%s]", "%s(%s)", "%s\\left[%s\\right]", "%s\\left(%s\\right)"], weigths=[3, 3, 1, 1]),
    "exp_function": RandomDecidedChoice(["e", "exp"], [4, 1]),
    "left_right_brackets": RandomTruthValue(0.2),
    "itex": RandomTruthValue(),
    "order": RandomChoice(["original", "random"], weights=[1, 6]),
    "blanks": RandomTruthValue(),
    "determinant": RandomDecidedChoice([r"\left|{%s}\right|", r"det\left(%s\right)"]),
    "frac": RandomChoice([r"\frac", r"\dfrac", r"\tfrac"], weights=[10, 3, 1]),
    "frac_short_mode": RandomTruthValue(),
    "set": RandomChoice([r"\left\{%s\right\}", r"\{%s\}"]),
    "subset": RandomDecidedChoice([r"\subset", r"\subseteq"]),
    "superset": RandomDecidedChoice([r"\supset", r"\supseteq"]),
    "condition_set": RandomChoice([r"\left\{%s \middle| %s \right\}", r"\{%s|%s\}", r"\{%s\mid %s\}",
                                   r"\left\{%s\; \middle|\; %s \right\}", r"\left\{%s : %s \right\}", r"\{%s \;:\; %s\}"]),
    "set_base_set_lhs": RandomTruthValue(probability_true=0.8),
    "formula_delimiter": RandomDecidedChoice([',', r'\wedge'], weigths=[0.8, 0.2]),
    "math_set": RandomDecidedChoice([r'\%s', r'\mathbb{%s}', r'\mathbf{%s}'], weigths=[2, 10, 1]),
    "cases_if": RandomDecidedChoice(['if', 'for']),
    "cases_else": RandomDecidedChoice(['otherwise', 'else'], weigths=[10, 4]),
    "cases_force_else": RandomTruthValue(),
    "cases_order": RandomChoice(['original', 'random']),
    "dots": RandomDecidedChoice([r'\dots', r'\cdots', '...', r'\ldots', r'\dotsm']),
    "implies": RandomDecidedChoice([r'\Rightarrow', r'\implies', r'\Longrightarrow', r'\rightarrow'], weigths=[10, 5, 4, 2]),
    "pi": RandomDecidedChoice([r'\pi', "π"], weigths=[10, 1]),
    "infinity": RandomDecidedChoice([r'\infty', '∞'], weigths=[10, 1]),
    "approx": RandomDecidedChoice([r'\approx', '≈'], weigths=[10, 1]),
    "emptyset": RandomDecidedChoice([r'\emptyset', r'\varnothing', '∅', r"\{\}"], weigths=[10, 6, 1, 3]),
    "set_complement": RandomDecidedChoice([r'%s^\complement', '%s^c', r'\overline{%s}']),
    "set_minus": RandomDecidedChoice([r'\setminus', r'\backslash']),
    "interval_open": RandomDecidedChoice([('(', ')'), (']', '[')], weigths=[5, 1]),
    "interval": RandomChoice(['%s%s%s', r"\left%s%s\right%s"]),
    "strip_.0": RandomTruthValue(),
    "space": RandomDecidedChoice([r'\:', r'\;', r'\,', r'\quad', ''], weigths=[1, 1, 1, 1, 3]),
    "defines": RandomDecidedChoice([':=', r'\coloneqq']),
    "choose": RandomDecidedChoice([r'\binom{%s}{%s}', r'{%s \choose %s}'])
}
