@@ -139,7 +139,7 @@ cl_lexicon_size <- function(corpus, p_attribute, registry = Sys.getenv("CORPUS_R
139139# ' fulltext <- paste(txt, collapse = " ")
140140cl_cpos2struc <- function (corpus , s_attribute , cpos , registry = Sys.getenv(" CORPUS_REGISTRY" )){
141141 check_registry(registry )
142- check_corpus(corpus , registry )
142+ check_corpus(corpus , registry , cqp = FALSE )
143143 check_s_attribute(corpus = corpus , registry = registry , s_attribute = s_attribute )
144144
145145 if (length(cpos ) == 0L ) return (integer())
@@ -151,7 +151,7 @@ cl_cpos2struc <- function(corpus, s_attribute, cpos, registry = Sys.getenv("CORP
151151# ' @rdname s_attributes
152152cl_struc2cpos <- function (corpus , s_attribute , registry = Sys.getenv(" CORPUS_REGISTRY" ), struc ){
153153 check_registry(registry )
154- check_corpus(corpus , registry )
154+ check_corpus(corpus , registry , cqp = FALSE )
155155 check_s_attribute(corpus = corpus , registry = registry , s_attribute = s_attribute )
156156 check_strucs(corpus = corpus , s_attribute = s_attribute , strucs = struc , registry = registry )
157157 .cl_struc2cpos(corpus = corpus , s_attribute = s_attribute , registry = registry , struc = struc )
@@ -160,7 +160,7 @@ cl_struc2cpos <- function(corpus, s_attribute, registry = Sys.getenv("CORPUS_REG
160160# ' @rdname s_attributes
161161cl_struc2str <- function (corpus , s_attribute , struc , registry = Sys.getenv(" CORPUS_REGISTRY" )){
162162 check_registry(registry )
163- check_corpus(corpus , registry )
163+ check_corpus(corpus , registry , cqp = FALSE )
164164 check_s_attribute(corpus = corpus , registry = registry , s_attribute = s_attribute )
165165 check_strucs(corpus = corpus , s_attribute = s_attribute , strucs = struc , registry = registry )
166166 .cl_struc2str(corpus = corpus , s_attribute = s_attribute , struc = struc , registry = registry )
@@ -169,7 +169,7 @@ cl_struc2str <- function(corpus, s_attribute, struc, registry = Sys.getenv("CORP
169169# ' @rdname s_attributes
170170cl_cpos2lbound <- function (corpus , s_attribute , cpos , registry = Sys.getenv(" CORPUS_REGISTRY" )){
171171 check_registry(registry )
172- check_corpus(corpus , registry )
172+ check_corpus(corpus , registry , cqp = FALSE )
173173 check_s_attribute(corpus = corpus , registry = registry , s_attribute = s_attribute )
174174
175175 if (length(cpos ) == 0L ) return (integer())
@@ -181,7 +181,7 @@ cl_cpos2lbound <- function(corpus, s_attribute, cpos, registry = Sys.getenv("COR
181181# ' @rdname s_attributes
182182cl_cpos2rbound <- function (corpus , s_attribute , cpos , registry = Sys.getenv(" CORPUS_REGISTRY" )){
183183 check_registry(registry )
184- check_corpus(corpus , registry )
184+ check_corpus(corpus , registry , cqp = FALSE )
185185 check_s_attribute(corpus = corpus , registry = registry , s_attribute = s_attribute )
186186
187187 check_cpos(corpus = corpus , p_attribute = " word" , cpos = cpos , registry = registry )
@@ -267,45 +267,45 @@ cl_cpos2rbound <- function(corpus, s_attribute, cpos, registry = Sys.getenv("COR
267267# '
268268cl_cpos2str <- function (corpus , p_attribute , registry = Sys.getenv(" CORPUS_REGISTRY" ), cpos ){
269269 check_registry(registry )
270- check_corpus(corpus , registry )
270+ check_corpus(corpus , registry , cqp = FALSE )
271271 if (length(cpos ) == 0L ) return (integer())
272272 .cl_cpos2str(corpus = corpus , p_attribute = p_attribute , registry = registry , cpos = cpos )
273273}
274274
275275# ' @rdname p_attributes
276276cl_cpos2id <- function (corpus , p_attribute , registry = Sys.getenv(" CORPUS_REGISTRY" ), cpos ){
277277 check_registry(registry )
278- check_corpus(corpus , registry )
278+ check_corpus(corpus , registry , cqp = FALSE )
279279 if (length(cpos ) == 0L ) return (integer())
280280 .cl_cpos2id(corpus = corpus , p_attribute = p_attribute , registry = registry , cpos = cpos )
281281}
282282
283283# ' @rdname p_attributes
284284cl_id2str <- function (corpus , p_attribute , registry = Sys.getenv(" CORPUS_REGISTRY" ), id ){
285285 check_registry(registry )
286- check_corpus(corpus , registry )
286+ check_corpus(corpus , registry , cqp = FALSE )
287287 check_id(corpus = corpus , p_attribute = p_attribute , id = id , registry = registry )
288288 .cl_id2str(corpus = corpus , p_attribute = p_attribute , registry = registry , id = id )
289289}
290290
291291# ' @rdname p_attributes
292292cl_regex2id <- function (corpus , p_attribute , regex , registry = Sys.getenv(" CORPUS_REGISTRY" )){
293293 check_registry(registry )
294- check_corpus(corpus , registry )
294+ check_corpus(corpus , registry , cqp = FALSE )
295295 .cl_regex2id(corpus = corpus , p_attribute = p_attribute , regex = regex , registry = registry )
296296}
297297
298298# ' @rdname p_attributes
299299cl_str2id <- function (corpus , p_attribute , str , registry = Sys.getenv(" CORPUS_REGISTRY" )){
300300 check_registry(registry )
301- check_corpus(corpus , registry )
301+ check_corpus(corpus , registry , cqp = FALSE )
302302 .cl_str2id(corpus = corpus , p_attribute = p_attribute , str = str , registry = registry )
303303}
304304
305305# ' @rdname p_attributes
306306cl_id2freq <- function (corpus , p_attribute , id , registry = Sys.getenv(" CORPUS_REGISTRY" )){
307307 check_registry(registry )
308- check_corpus(corpus , registry )
308+ check_corpus(corpus , registry , cqp = FALSE )
309309 check_p_attribute(p_attribute = p_attribute , corpus = corpus , registry = registry )
310310 check_id(corpus = corpus , p_attribute = p_attribute , id = id , registry = registry )
311311 .cl_id2freq(corpus = corpus , p_attribute = p_attribute , id = id , registry = registry )
@@ -315,7 +315,7 @@ cl_id2freq <- function(corpus, p_attribute, id, registry = Sys.getenv("CORPUS_RE
315315# ' @rdname p_attributes
316316cl_id2cpos <- function (corpus , p_attribute , id , registry = Sys.getenv(" CORPUS_REGISTRY" )){
317317 check_registry(registry )
318- check_corpus(corpus , registry )
318+ check_corpus(corpus , registry , cqp = FALSE )
319319 check_p_attribute(p_attribute = p_attribute , corpus = corpus , registry = registry )
320320 check_id(corpus = corpus , p_attribute = p_attribute , id = id , registry = registry )
321321 .cl_id2cpos(corpus = corpus , p_attribute = p_attribute , id = id , registry = registry )
@@ -394,7 +394,7 @@ cl_charset_name <- function(corpus, registry = Sys.getenv("CORPUS_REGISTRY")){
394394# ' cl_struc_values("REUTERS", "places") # TRUE - attribute has values
395395# ' cl_struc_values("REUTERS", "date") # NA - attribute does not exist
396396cl_struc_values <- function (corpus , s_attribute , registry = Sys.getenv(" CORPUS_REGISTRY" )){
397- check_corpus(corpus = corpus , registry = registry )
397+ check_corpus(corpus = corpus , registry = registry , cqp = FALSE )
398398 registry <- normalizePath(path.expand(registry ))
399399 i <- .cl_struc_values(corpus = corpus , s_attribute = s_attribute , registry = registry )
400400 if (i == 1L ) TRUE else if (i == 0L ) FALSE else if (i < 0L ) as.integer(NA )
@@ -414,19 +414,20 @@ cl_struc_values <- function(corpus, s_attribute, registry = Sys.getenv("CORPUS_R
414414# ' @examples
415415# ' corpus_data_dir("REUTERS", registry = get_tmp_registry())
416416corpus_data_dir <- function (corpus , registry = Sys.getenv(" CORPUS_REGISTRY" )){
417- check_corpus(corpus = corpus , registry = registry )
417+ check_corpus(corpus = corpus , registry = registry , cqp = FALSE )
418418 registry <- path(path_expand(registry ))
419419 dir <- .corpus_data_dir(corpus = corpus , registry = registry )
420420 path(dir )
421421}
422422
423423# ' @details `corpus_info_file()` will return the path to the info file for a
424- # ' corpus (class `fs_path` object).
424+ # ' corpus (class `fs_path` object). If info file does not exist or INFO line
425+ # ' is missing in the registry file, `NA` is returned.
425426# ' @rdname registry_info
426427# ' @examples
427428# ' corpus_info_file("REUTERS", registry = get_tmp_registry())
428429corpus_info_file <- function (corpus , registry = Sys.getenv(" CORPUS_REGISTRY" )){
429- check_corpus(corpus = corpus , registry = registry )
430+ check_corpus(corpus = corpus , registry = registry , cqp = FALSE )
430431 registry <- path(path_expand(registry ))
431432 fname <- .corpus_info_file(corpus = corpus , registry = registry )
432433 path(fname )
@@ -438,7 +439,7 @@ corpus_info_file <- function(corpus, registry = Sys.getenv("CORPUS_REGISTRY")){
438439# ' @examples
439440# ' corpus_full_name("REUTERS", registry = get_tmp_registry())
440441corpus_full_name <- function (corpus , registry = Sys.getenv(" CORPUS_REGISTRY" )){
441- check_corpus(corpus = corpus , registry = registry )
442+ check_corpus(corpus = corpus , registry = registry , cqp = FALSE )
442443 registry <- path(path_expand(registry ))
443444 .corpus_full_name(corpus = corpus , registry = registry )
444445}
@@ -449,7 +450,7 @@ corpus_full_name <- function(corpus, registry = Sys.getenv("CORPUS_REGISTRY")){
449450# ' @examples
450451# ' corpus_p_attributes("REUTERS", registry = get_tmp_registry())
451452corpus_p_attributes <- function (corpus , registry = Sys.getenv(" CORPUS_REGISTRY" )){
452- check_corpus(corpus = corpus , registry = registry )
453+ check_corpus(corpus = corpus , registry = registry , cqp = FALSE )
453454 registry <- path(path_expand(registry ))
454455 .corpus_p_attributes(corpus = corpus , registry = registry )
455456}
@@ -460,7 +461,7 @@ corpus_p_attributes <- function(corpus, registry = Sys.getenv("CORPUS_REGISTRY")
460461# ' @examples
461462# ' corpus_s_attributes("REUTERS", registry = get_tmp_registry())
462463corpus_s_attributes <- function (corpus , registry = Sys.getenv(" CORPUS_REGISTRY" )){
463- check_corpus(corpus = corpus , registry = registry )
464+ check_corpus(corpus = corpus , registry = registry , cqp = FALSE )
464465 registry <- path(path_expand(registry ))
465466 .corpus_s_attributes(corpus = corpus , registry = registry )
466467}
@@ -471,7 +472,7 @@ corpus_s_attributes <- function(corpus, registry = Sys.getenv("CORPUS_REGISTRY")
471472# ' @examples
472473# ' corpus_properties("REUTERS", registry = get_tmp_registry())
473474corpus_properties <- function (corpus , registry = Sys.getenv(" CORPUS_REGISTRY" )){
474- check_corpus(corpus = corpus , registry = registry )
475+ check_corpus(corpus = corpus , registry = registry , cqp = FALSE )
475476 registry <- path(path_expand(registry ))
476477 .corpus_properties(corpus = corpus , registry = registry )
477478}
@@ -492,7 +493,7 @@ corpus_property <- function(corpus, registry = Sys.getenv("CORPUS_REGISTRY"), pr
492493 length(property ) == 1L ,
493494 is.character(property )
494495 )
495- check_corpus(corpus = corpus , registry = registry )
496+ check_corpus(corpus = corpus , registry = registry , cqp = FALSE )
496497 registry <- path(path_expand(registry ))
497498 .corpus_property(corpus = corpus , registry = registry , property = property )
498499}
0 commit comments