def find_emoji(data, text):
    """Test whether text has an emoji

    :param data: Output of :py:func:`create_data_structure`
    :type data: dict
    :return: list of pairs, init and end of the word
    :rtype: list
    """
    blocks = list()
    init = i = end = 0
    head = data
    current = head
    while i < len(text):
        char = text[i]
        try:
            current = current[char]
            i += 1
            if '__end__' in current:
                end = i
        except KeyError:
            current = head
            if end > init:
                blocks.append([init, end])
                init = i = end
            elif i > init:
                init = end = i
            else:
                init += 1
                i = end = init
    if end > init:
        blocks.append([init, end])
    return blocks
