from typing import Tuple


def check_format(path: str) -> Tuple[bool, bool]:
    """
    Check the pronunciation dictionary format

    Parameters
    ----------
    path: str
        Path of pronunciation dictionary

    Returns
    -------
    bool
        Flag for whether the dictionary has pronunciation probabilities
    bool
        Flag for whether the dictionary includes silence probabilities
    """
    count = 0
    pronunciation_probabilities = True
    silence_probabilities = True
    with open(path, "r", encoding="utf8") as f:
        for line in f:
            line = line.strip()
            if not line:
                continue
            line = line.split()
            _ = line.pop(0)  # word
            next_item = line.pop(0)
            if pronunciation_probabilities:
                try:
                    prob = float(next_item)
                    if prob > 1 or prob < 0:
                        raise ValueError
                except ValueError:
                    pronunciation_probabilities = False
            try:
                next_item = line.pop(0)
            except IndexError:
                silence_probabilities = False
            if silence_probabilities:
                try:
                    prob = float(next_item)
                    if prob > 1 or prob < 0:
                        raise ValueError
                except ValueError:
                    silence_probabilities = False
            count += 1
            if count > 10:
                break
    return pronunciation_probabilities, silence_probabilities