as_word_tag: Combine Words + Tags

Description Usage Arguments Value Examples

Description

A traditional style of displaying words and tags in the same vector.

Usage

1
as_word_tag(x, sep = "/", word.first = TRUE, ...)

Arguments

x

A tag_pos object or a named list of vectors.

sep

A separator to put between the word and the tag.

word.first

logical. If TRUE the word comes before the tag.

...

ignored.

Value

Returns a combined character vector of words and tags.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
(x <- tag_pos("I need $54 to go to the movies."))
c(x) ## The true structure of a `tag_pos` object
as_word_tag(c(x))
as_word_tag(c(x), word.first=FALSE)
as_word_tag(c(x), sep="|")
gsub("([^ ]+)", "(\\1)", as_word_tag(c(x), sep="="))

(out1 <- tag_pos(sam_i_am))
c(out1)
as_word_tag(c(out1))

trinker/tagger documentation built on May 31, 2019, 10:42 p.m.