def splitTag(chunkTag, oTag = "O", raw = False):
    """
    Split chunk tag into IOB tag and chunk type;
    return (iob_tag, chunk_type)
    """
    if chunkTag == "O" or chunkTag == oTag:
        tag, type_ = "O", None
    elif raw:
        tag, type_ = "B", chunkTag
    else:
        try:
            # split on first hyphen, allowing hyphen in type
            tag, type_ = chunkTag.split('-', 1)
        except ValueError:
            tag, type_  = chunkTag, None
    return tag, type_