match_word: Regular Expression Matching of Words in a Text

Description Usage Arguments Value Examples

View source: R/match_word.R

Description

Extract the words from a text that match a regular expression.

Usage

1
match_word(text.var, term.list, ...)

Arguments

text.var

The text string variable.

term.list

A list of named character vectors.

...

ignored.

Value

Returns a list of matched word vectors.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
match_word(
    text.var = c(
        'the dog is todo them funny',
        'I\'d wait to eat the sandwich.',
        'the dog ate the sandwiches'
    ),
    term.list = c('the', 'sandwich', 'do', '^do', '\\bdo', 'do$')
)

match_word(
    text.var = c(
        'the dog is todo them funny',
        'I\'d wait to eat the sandwich.',
        'the dog ate the sandwiches'
    ),
    term.list = list(
        'the',
        'sandwich',
        'do',
        '^do',
        '\\bdo',
        'do$',
        '\\b(eat|ate)\\b'
    )
)

trinker/termco documentation built on Jan. 7, 2022, 3:32 a.m.