def is_annotated(page_id, line_n, token, annotations):
        """
        Check whether the input token has attached an annotation.

        Args:
        - token: dictionary
        - annotations: list of dictionaries

        Returns True or False
        """
        positions = [p for a in annotations for p in a["positions"]]
        for position in positions:
            if(position["page_id"]==page_id):
                if(position["line_n"]==line_n):
                    if(token["offset_start"] >= position["start"]):
                        if(token["offset_end"] <= position["end"]):
                            return True
        return False