The corpus_text type is a new data type provided by the corpus
package suitable for processing international (Unicode) text. Text vectors
behave like character vectors (and can be converted to them with the
as.character function). They can be created using the
read_ndjson function or by converting another object using the
as_corpus_text function.
All text objects have a text_filter property specify how to
transform the text into tokens or segment it into sentences.
The default behavior for as_corpus_text is to proceed as follows:
If x is a character vector, then we create
    a new text vector from x.
 
If x is a data frame, then we call as_corpus_text
     on x$text if a column named "text" exists in
     the data frame.  If the data frame does not have a column
     named "text", then we fail with an error message.
 
If x is a corpus_text object, then we drop all
     attributes and we set the class to "corpus_text".
 
The default behavior for when none of the above conditions
     are true is to call as.character on the object first,
     preserving the names, and then and call as_corpus_text on
     the returned character object.
 
In all cases, when the names is NULL, we set the result
names to names(x) (or rownames(x) for a data frame
argument). When names is a character vector, we set the result names
to this vector of names
Similarly, when filter is NULL, we set the result text
filter to text_filter(x). When filter is non-NULL
missing, we set the result text filter to this value. In either case,
if there are additional names arguments, then we override the filter
properties specified by the names of these arguments with the new values
given.
Note that the special handling for the names of the object is different
from the other R conversion functions (as.numeric,
as.character, etc.), which drop the names.
as_corpus_text is generic: you can write methods to handle specific
classes of objects.