types <- c("A", "AA", "B", "BB", "B_B", "C", "C-C")
# dictionary
dict <- dictionary(list(A = c("a", "aa"),
B = c("BB", "B B"),
C = c("C", "C-C")))
object2fixed(dict, types)
object2fixed(dict, types, remove_unigram = TRUE)
# phrase
pats <- phrase(c("a", "aa", "zz", "bb", "b b"))
object2fixed(pats, types)
object2fixed(pats, types, keep_nomatch = TRUE)
Run the code above in your browser using DataLab