Description Usage Arguments Value Examples
Extract highest level phrases from a sentence (see http://www.surdeanu.info/mihai/teaching/ista555-spring15/readings/PennTreebankConstituents.html for more on phrase types).
1 | get_phrases(x)
|
x |
A parsed character string or list (see |
Returns a list of character vectors of highest level phrases.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
txt <- c(
"Really, I like chocolate because it is good. It smells great.",
"Robots are rather evil and most are devoid of decency.",
"He is my friend.",
"Clifford the big red dog ate my lunch.",
"Professor Johns can not teach",
"",
NA
)
if(!exists('parse_ann')) {
parse_ann <- parse_annotator()
}
(x <- parser(txt, parse_ann))
get_phrases(x)
lapply(get_phrases(x), get_leaves)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.