'Construct a Brill tagger from a baseline tagger and a
set of templates
:param initial_tagger: the baseline tagger
:type initial_tagger: Tagger
:param templates: templates to be used in training
:type templates: list of Templates
:param trace: verbosity level
:type trace: int
:param deterministic: if True, adjudicate ties deterministically
:type deterministic: bool
:param ruleformat: format of reported Rules
:type ruleformat: str
:return: An untrained BrillTagger
:rtype: BrillTagger'

def __init__(self, initial_tagger, templates, trace=0, deterministic=None, ruleformat='str'):

    if (deterministic is None):
        deterministic = (trace > 0)
    self._initial_tagger = initial_tagger
    self._templates = templates
    self._trace = trace
    self._deterministic = deterministic
    self._ruleformat = ruleformat
    self._tag_positions = None
    'Mapping    from    tags    to    lists    of    positions    that    use    that    tag.'
    self._rules_by_position = None
    "Mapping    from    positions    to    the    set    of    rules    that    are    known\n                                            to    occur    at    that    position.        Position    is    (sentnum,    wordnum).\n                                            Initially,    this    will    only    contain    positions    where    each    rule\n                                            applies    in    a    helpful    way;    but    when    we    examine    a    rule,    we'll\n                                            extend    this    list    to    also    include    positions    where    each    rule\n                                            applies    in    a    harmful    or    neutral    way."
    self._positions_by_rule = None
    "Mapping    from    rule    to    position    to    effect,    specifying    the\n                                            effect    that    each    rule    has    on    the    overall    score,    at    each\n                                            position.        Position    is    (sentnum,    wordnum);    and    effect    is\n                                            -1,    0,    or    1.        As    with    _rules_by_position,    this    mapping    starts\n                                            out    only    containing    rules    with    positive    effects;    but    when\n                                            we    examine    a    rule,    we'll    extend    this    mapping    to    include\n                                            the    positions    where    the    rule    is    harmful    or    neutral."
    self._rules_by_score = None
    'Mapping    from    scores    to    the    set    of    rules    whose    effect    on    the\n                                            overall    score    is    upper    bounded    by    that    score.        Invariant:\n                                            rulesByScore[s]    will    contain    r    iff    the    sum    of\n                                            _positions_by_rule[r]    is    s.'
    self._rule_scores = None
    'Mapping    from    rules    to    upper    bounds    on    their    effects    on    the\n                                            overall    score.        This    is    the    inverse    mapping    to    _rules_by_score.\n                                            Invariant:    ruleScores[r]    =    sum(_positions_by_rule[r])'
    self._first_unknown_position = None
    "Mapping    from    rules    to    the    first    position    where    we're    unsure\n                                            if    the    rule    applies.        This    records    the    next    position    we\n                                            need    to    check    to    see    if    the    rule    messed    anything    up."
