entities <- function(doc, kind) { s <- doc$content a <- annotations(doc)[[1]] if(hasArg(kind)) { k <- sapply(a$features, `[[`, "kind") s[a[k == kind]] } else { s[a[a$type == "entity"]] }}
这就是对象的偏