Example:
my_dict <- dictionary(list(
use = "firstuse",
document = "document*",
use = c("use", "using")
))
# Dictionary object with 3 key entries.
# - use:
# - firstuse
# - document:
# - document*
# - use:
# - use, using
We have tested whether this creates a problem for the *l_lookup functions, and it does not:
toks <- tokens("firstuse documenting using word word2")
# tokens from 1 document.
# text1 :
# [1] "use" "document" "use"
# Document-feature matrix of: 1 document, 2 features (0% sparse).
# 1 x 2 sparse Matrix of class "dfm"
# features
# docs use document
# text1 2 1
but it does create a problem for indexing.
my_dict[which(names(my_dict)=="use")]
# Dictionary object with 1 key entry.
# - use:
# - use, using
my_dict[c(1:3)]
# Dictionary object with 2 key entries.
# - use:
# - use, using
# - document:
# - document*
Example:
We have tested whether this creates a problem for the
*l_lookupfunctions, and it does not:but it does create a problem for indexing.