# Path: praatio/textgrid.py
# def openTextgrid(
#     fnFullPath: str,
#     includeEmptyIntervals: bool,
#     reportingMode: Literal["silence", "warning", "error"] = "warning",
#     duplicateNamesMode: Literal["error", "rename"] = "error",
# ) -> Textgrid:
# def _dictionaryToTg(
#     tgAsDict: dict, reportingMode: Literal["silence", "warning", "error"]
# ) -> Textgrid:


import os
from os.path import join
from praatio import textgrid
"""
Example of using praatio for merging intervals that share a border.
"""




def merge_adjacent(path, fn, outputPath):
    """
    Goes through every tier of a textgrid; combines adjacent filled intervals
    """

    assert path != outputPath

    if not os.path.exists(outputPath):
        os.mkdir(outputPath)

    outputTG = textgrid.Textgrid()


# Path: praatio/textgrid.py
# def openTextgrid(
#     fnFullPath: str,
#     includeEmptyIntervals: bool,
#     reportingMode: Literal["silence", "warning", "error"] = "warning",
#     duplicateNamesMode: Literal["error", "rename"] = "error",
# ) -> Textgrid:
# def _dictionaryToTg(
#     tgAsDict: dict, reportingMode: Literal["silence", "warning", "error"]
# ) -> Textgrid:


# Path: examples/merge_adjacent_intervals.py
import os
from os.path import join
from praatio import textgrid

"""
Example of using praatio for merging intervals that share a border.
"""




def merge_adjacent(path, fn, outputPath):
    """
    Goes through every tier of a textgrid; combines adjacent filled intervals
    """

    assert path != outputPath

    if not os.path.exists(outputPath):
        os.mkdir(outputPath)

    outputTG = textgrid.Textgrid()


    tg = textgrid.openTextgrid(join(path, fn), False)