Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (11 sloc) 402 Bytes
# prosta lematyzacja w R
# https://wilkowski.org/notka/1587
getLemma <- function(t,u) {
library(httr)
library(xml2)
p <- list(lpmn="any2txt|wcrft2",text=t,user=u)
s <- POST("http://ws.clarin-pl.eu/nlprest2/base/process", body = p, encode = "json", verbose())
r <- content(s, "text")
r <- gsub('[[:punct:] ]+','',unlist(as_list(xml_find_all(read_xml(r),"//base"))))
return(r[r != ""])
}