def check_word_format(w):
    """
    Check whether specified word format is either ``(W, WI, WF)`` or ``(W, WI)``
    
    Arguments
    ---------
    w : tuple
      ``(W, WI, WF)`` or ``(W, WI)``, items need to be integer
      
    Returns
    -------
    Tuple
        ``(W, WI, WF)``    
    """
    if len(w) == 2:
        fwl = w[0] - w[1] - 1
        assert fwl >= 0
        wf = (w[0], w[1], )
    elif len(w) == 3:
        wf = w
    else:
        raise Exception("Invalid word format")
    return wf