Currently, tokens_compound() updates the default concatenator but I don't think it should.
Currently
require(quanteda)
toks <- tokens(c(doc1 = "New York is over crowded"), concatenator = " ") %>%
tokens_compound(phrase("over crowded"), concatenator = "") %>%
tokens_compound(phrase("New York"))
print(toks)
#> Tokens consisting of 1 document.
#> doc1 :
#> [1] "NewYork" "is" "overcrowded"
Should be
require(quanteda)
toks <- tokens(c(doc1 = "New York is over crowded"), concatenator = " ") %>%
tokens_compound(phrase("over crowded"), concatenator = "") %>%
tokens_compound(phrase("New York")) # use the default concatenator
print(toks)
#> Tokens consisting of 1 document.
#> doc1 :
#> [1] "New York" "is" "overcrowded"
Currently,
tokens_compound()updates the default concatenator but I don't think it should.Currently
Should be