Description Usage Arguments Details Value Examples
The function conc_re
builds a concordance for the matches of
a regular expression. The result is a dataset that can be written
to a file with the function write_dataset
. The function
mimics the behaviour of the concordance tool in the program
AntConc.
1 2 3 4 5 6 7 8 |
pattern |
the argument |
x |
the argument |
c_left |
the argument |
c_right |
the argument |
perl |
in case of the setting |
after_line |
prior to the actual search operation, the lines from a corpus file are
concatenated
into one single character string,
using, as separator between the lines of the file, the value given in
|
file_encoding |
each corpus file is interpreted as a text file the encoding of which is
the one given in |
as_text |
in case of the setting |
In order to make sure that the columns left
, match
,
and right
in the
output of conc_re
do not contain any TAB or NEWLINE characters,
whitespace in these items is
being ‘normalized’. More particularly, each stretch of whitespace, i.e. each
uninterrupted sequences of whitespace characters, is replaced by
a single SPACE character.
The values in the items the glob_id
and id
in the output
of conc_re
are always identical in a
dataset that is the output of the function conc_re
. The item
glob_id
only becomes useful when later, for instance, one wants to merge two datasets.
Returns an object of the class conc
, which is a kind of data frame
with as its rows the matches and with the following columns:
glob_id |
Number indicating the position of the match in the overall list of matches. |
id |
Number indicating the position of the match in the list of matches for one specific query. |
source |
Either the filename of the file in which the match was
found (in case of the setting
|
left |
The lefthandside co-text of each match. |
match |
The actual match. |
right |
The righthandside co-text of each match. |
1 2 | (conc_data <- conc_re('\\w+', 'A very small corpus.', as_text = TRUE))
print_kwic(conc_data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.