cbind_morphological {udpipe} | R Documentation |
The result of udpipe_annotate
which is put into a data.frame
returns a field called feats
containing morphological features as defined at
http://universaldependencies.org/u/feat/index.html. If there are several of these features,
these are concatenated with the |
symbol. This function extracts each of these morphological
features separately and adds these as extra columns to the data.frame
cbind_morphological(x, term = "feats")
x |
a data.frame or data.table as returned by |
term |
the name of the field in |
x
in the same order with extra columns added (at least the column has_morph is added indicating
if any morphological features are present and as well extra columns for each possible morphological feature in the data)
## Not run: udmodel <- udpipe_download_model(language = "english-ewt") udmodel <- udpipe_load_model(file = udmodel$file_model) x <- udpipe_annotate(udmodel, x = "The economy is weak but the outlook is bright") x <- as.data.frame(x) x <- cbind_morphological(x, term = "feats") ## End(Not run) f <- system.file(package = "udpipe", "dummydata", "traindata.conllu") x <- udpipe_read_conllu(f) x <- cbind_morphological(x, term = "feats")