Esempio n. 1
0
def player_addresees(edu):
    """
    The set of people spoken to during an edu annotation.
    This excludes known non-players, like 'All', or '?', or 'Please choose...',
    """
    addr1 = addressees(edu) or frozenset()
    return frozenset(x for x in addr1 if x not in ['All', '?'])
Esempio n. 2
0
def player_addresees(edu):
    """
    The set of people spoken to during an edu annotation.
    This excludes known non-players, like 'All', or '?', or 'Please choose...',
    """
    addr1 = addressees(edu) or frozenset()
    return frozenset(x for x in addr1 if x not in ['All', '?'])
Esempio n. 3
0
def is_empty_dialogue_act(anno):
    """Return True if anno is an empty dialogue act.

    This is defined as:
    - having span length 0 or
    - no addressee and no surface act.

    Parameters
    ----------
    anno : Annotation
        Annotation to be tested

    Returns
    -------
    res : boolean
        True if `anno` is an empty dialogue act.
    """
    return (is_edu(anno) and anno.type in DIALOGUE_ACTS
            and addressees(anno) is None
            and (anno.features.get('Surface_act') == 'Please choose...'))
Esempio n. 4
0
def is_empty_dialogue_act(anno):
    """Return True if anno is an empty dialogue act.

    This is defined as:
    - having span length 0 or
    - no addressee and no surface act.

    Parameters
    ----------
    anno : Annotation
        Annotation to be tested

    Returns
    -------
    res : boolean
        True if `anno` is an empty dialogue act.
    """
    return (is_edu(anno) and
            anno.type in DIALOGUE_ACTS and
            addressees(anno) is None and
            (anno.features.get('Surface_act') == 'Please choose...'))