extract_generic: Extract Generic Entities From Phrase

Description Usage Arguments Details Value Examples

View source: R/extract_generic.R

Description

This function searches a phrase for the position and length of expressions specified in a dictionary.

Usage

1
extract_generic(phrase, dict)

Arguments

phrase

Text to search.

dict

data.frame, the first column should contain expressions to find. These can be regular expressions or exact phrases.

Details

extract_generic is used to extract entities that are identified with an associated dictionary of phrases or regular expressions, such as frequency or intake time in medExtractR. This function is called within extract_entities.

Value

A numeric matrix with position and expression length.

Examples

1
2
3
4
data(freq_vals)
extract_generic("take two every day", freq_vals)
extract_generic("take two every morning",
                  data.frame(c("morning", "every morning")))

medExtractR documentation built on Aug. 1, 2020, 1:07 a.m.