Learn R Programming

quanteda (version 0.99)

spacyr-methods: extensions of methods defined in the quanteda package

Description

Extensions to quanteda functions. You must have attached quanteda for these to work.

Arguments

x

an object returned by spacy_parse

...

unused

Usage

docnames(x) returns the document names

ndoc(x) returns the number of documents

ntoken(x, ...) returns the number of tokens by document

ntype(x, ...) returns the number of types (unique tokens) by document

Examples

Run this code
# NOT RUN {
require(spacyr)
spacy_initialize()
txt <- c(doc1 = "And now, now, now for something completely different.",
         doc2 = "Jack and Jill are children.")
parsed <- spacy_parse(txt)
ntype(parsed)
ntoken(parsed)
ndoc(parsed)
docnames(parsed)
# }

Run the code above in your browser using DataLab