def parse_syllable_ranges(input_str: str) -> List[List[int]]:
    """Convert a bunch of syllable ranges into a list of intervals.

    Examples:
        parse_syllable_ranges('[7,10][7, 10][5,7][5,7][7,10]')
        >>> [[7, 10], [7, 10], [5, 7], [5, 7], [7, 10]]
        parse_syllable_ranges('575 575')
        >>> [[5, 5], [7, 7], [5, 5], [0, 0], [5, 5], [7, 7], [5, 5]]
        parse_syllable_ranges('[11]5')
        >>> [[11, 11], [5, 5]]
    """

    def convert_to_range(match):
        match = match.strip("[]")
        if "," in match:
            start, end = map(int, match.split(","))
            return [start, end]
        elif match == " ":
            return [0, 0]
        else:
            num = int(match)
            return [num, num]

    # Split the input string into chunks
    chunks = re.findall(r"(?:\[\d+(?:,\s*\d+)?\]|\d| )", input_str.strip())

    # Convert each chunk to a range and create the result list
    result = [convert_to_range(chunk) for chunk in chunks]

    return result
Convert a bunch of syllable ranges into a list of intervals.

    Examples:
        parse_syllable_ranges('[7,10][7, 10][5,7][5,7][7,10]')
        >>> [[7, 10], [7, 10], [5, 7], [5, 7], [7, 10]]
        parse_syllable_ranges('575 575')
        >>> [[5, 5], [7, 7], [5, 5], [0, 0], [5, 5], [7, 7], [5, 5]]
        parse_syllable_ranges('[11]5')
        >>> [[11, 11], [5, 5]]
    
vlmeval/dataset/utils/megabench/parsing/common/parsers.py