def add_start(automaton, tids, rule_identifier, rule_length):
    """
    Add the `tids` sequence of starting token ids for the `rule_identifier` Rule
    or `rule_length` to the an Aho-Corasick `automaton`.
    """
    tokens = tuple(tids)
    existing = automaton.get(tokens, None)
    value = rule_length, rule_identifier
    if existing:
        existing.append(value)
    else:
        automaton.add_word(tokens, [value])
