def _extract_values_from_rpdr_notes(
rpdr_notes, phrase_type, phrases, ignore_punctuation,
show_n_words_context_before, show_n_words_context_after):
"""Return a list of NotePhraseMatches for each note in rpdr_notes."""
note_phrase_matches = []
if ignore_punctuation:
logging.info('ignore_punctuation is True, so we will also ignore '
'any punctuation in the entered phrases.')
phrases = [_remove_punctuation(phrase) for phrase in phrases]
match_contexts = PhraseMatchContexts(
show_n_words_context_before, show_n_words_context_after)
for rpdr_note in rpdr_notes:
if ignore_punctuation:
rpdr_note.remove_punctuation_from_note()
phrase_matches = _extract_phrase_from_notes(phrase_type, phrases,
rpdr_note, match_contexts)
note_phrase_matches.append(phrase_matches)
match_contexts.print_ordered_contexts()
return note_phrase_matches
评论列表
文章目录