(word)
return pairs
Return set of symbol pairs in a word.

    word is represented as tuple of symbols (symbols being variable-length strings)
Return set of symbol pairs in a word.
Return set of symbol pairs in a word .
def get_pairs(word):
    """Return set of symbol pairs in a word.

    word is represented as tuple of symbols (symbols being variable-length strings)
    """
    pairs = set()
    prev_char = word[0]
    for char in word[1:]:
        pairs.add((prev_char, char))
        prev_char = char
    return pairs
def get_pairs ( word ) : pairs = set ( ) prev_char = word [ 0 ] for char in word [ 1 : ] : pairs . add ( ( prev_char , char ) ) prev_char = char return pairs