from typing import Dict
from typing import List


def words_from_results(ocr_result: Dict) -> List[Dict]:
    """Returns the list of found words (bounding box and text)

    Note: the dictionary for each word has two fields "text" and "boundingBox",
    which represent the content and location of the extracted word respectively

    :param Dict[] ocr_results: OCR results for an image
    :returns List[Dict]:the words found in the OCR results
    """

    line_infos = [region["lines"] for region in ocr_result["regions"]]
    word_infos = []

    for line in line_infos:
        for word_metadata in line:
            for word_info in word_metadata["words"]:
                word_infos.append(word_info)

    return word_infos