谁能帮我解释一下这段代码啊?r nlp
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"]] }}
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"]] }}
2018-10-16
举报