R/importSynonyms.R

Defines functions importSynonyms

Documented in importSynonyms

importSynonyms <- function(file){
	datf <- read.table(file, header=TRUE, as.is=TRUE)
	if(paste(names(datf), collapse="") != "phrasetablekey"){
		stop("file seems not to be a synonym export")
	}
	for(i in 1:NROW(datf)){
		cat("Importing: ", datf$phrase[i], "\n")
		try(addSynonym(table=datf$table[i], phrase=datf$phrase[i], id=datf$key[i]))
	}
	cat(NROW(datf), " synonyms imported \n")
}

Try the RObsDat package in your browser

Any scripts or data that you put into this service are public.

RObsDat documentation built on May 31, 2017, 4:20 a.m.