def parse(chord):
if len(chord) > <NUM_LIT:1> and chord[<NUM_LIT:1>] in ("<STR_LIT:b>", "<STR_LIT:#>"):<EOL><INDENT>root = chord[:<NUM_LIT:2>]<EOL>rest = chord[<NUM_LIT:2>:]<EOL><DEDENT>else:<EOL><INDENT>root = chord[:<NUM_LIT:1>]<EOL>rest = chord[<NUM_LIT:1>:]<EOL><DEDENT>check_note(root, chord)<EOL>on_chord_idx = rest.find("<STR_LIT:/>")<EOL>if on_chord_idx >= <NUM_LIT:0>:<EOL><INDENT>on = rest[on_chord_idx + <NUM_LIT:1>:]<EOL>rest = rest[:on_chord_idx]<EOL>check_note(on, chord)<EOL><DEDENT>else:<EOL><INDENT>on = None<EOL><DEDENT>if rest in QUALITY_DICT:<EOL><INDENT>quality = Quality(rest)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>".format(chord, rest))<EOL><DEDENT>appended = []<EOL>return root, quality, appended, on<EOL>
Parse a string to get chord component

    :param str chord: str expression of a chord
    :rtype: (str, pychord.Quality, str, str)
    :return: (root, quality, appended, on)