places4text6tags: returns the places of a series of tags within a /text/

Description Usage Arguments Details Value Examples

Description

From a text, independently for a series of tags, gives back the positions where they are in the text. A position is given by four values (li1,co1,li2,co2), respectively the numbers of line and column of the first character and last character of the tag.
Non-overlapping between tags can be checked.

Usage

1
2

Arguments

text

A character vector containing the text.

tags

character() the series of tags to be considered.

check

Must overlapping be checked?

Details

One tags cannot be upon two successive lines. The same line can have more than one tag. This is a clear generalization of the function text3places8word which is called to elaborate the result.
If some tags have an intersection in the text, the case is considered as no acceptable and a fatal error is issued. For instance in "The computation is performed" the two tags "perf" and "formed" are not compatible; that is
places4text6tags("is performed",c("perf","formed")) stops with a fatal error.

Value

A five column data frame: a line for each found tag indicated by a factor; four columns giving respectively the line, the beginning and ending positions plus the fifth column to indicate the corresponding tag value. When they exist names(tags) are used for the row dimnames.

Examples

1
2
3
4
5
6
7
 
  places4text6tags("Bonjour Monsieur","on"); 
  places4text6tags("Bonjour Monsieur",c("on","ons","mon")); 
  ## Not run: places4text6tags("Bonjour Monsieur",c("on","ons","mon"),check=TRUE); 
  places4text6tags(rbsa0$text1$v,c("1","2","7")); 
  places4text6tags(rbsa0$text2$v[1:3],"t"); 
  places4text6tags(rbsa0$text3$v,"uu"); 

rbsa documentation built on May 2, 2019, 6:07 p.m.