def match_up_stmts_to_sentence_positions(stmts_with_json, reach_json):
    """Match up raw statements to positions in reach sentence metadata

    Parameters
    ----------
    stmts_with_json : list
        A list of tuples of the form (raw_stmt_id, stmt_json) where
        the statement json is in dict form.
    reach_json : dict
        A reach output json in dict form

    Returns
    -------
    dict
        A dictionary mapping raw statement ids to nested tuples of the
        form (sentence_id, (start_pos, end_pos)) where sentence_id is the
        id of the evidence sentence within the reach json and start_pos and
        end_pos are the coordinates for the evidence sentence within article
        as given in the sentence metadata in the reach_json.
    """
    text_to_sentence_ids = {frame['verbose-text']: frame['sentence'] for
                            frame in reach_json['events']['frames']
                            if 'verbose-text' in frame}
    sentence_positions = {frame['frame-id']: (frame['start-pos']['offset'],
                                              frame['end-pos']['offset'])
                          for frame in reach_json['sentences']['frames']
                          if 'start-pos' in frame}
    stmts_to_sentence_positions = {}
    for stmt_id, stmt_json in stmts_with_json.items():
        evidence_text = stmt_json['evidence'][0]['text']
        sentence_id = text_to_sentence_ids[evidence_text]
        stmts_to_sentence_positions[stmt_id] = \
            (sentence_id, sentence_positions[sentence_id])
    return stmts_to_sentence_positions