Learn R Programming

rcqp (version 0.5)

cqi_attribute_size: Get the size of an attribute

Description

Find the number of items (type/category or token/individual) of an attribute.

Usage

cqi_attribute_size(attribute)
	cqi_structural_attribute_has_values(attribute)
	cqi_lexicon_size(attribute)

Arguments

attribute

(string) the qualified name of an attribute.

Value

cqi_attribute_size returns an integer which is the number of different items in the corpus marked with the specified attribute.

cqi_structural_attribute_has_values returns a logical value telling whether the specified attribute has values (TRUE) or not (FALSE).

cqi_lexicon_size returns an integer value.

Details

The cqi_attribute_size indicates the number of actual elements (number of occurrences) of an attributes:

  • on a positionnal attribute, it gives the number of tokens.

  • on a structural attribute, it gives the number of regions.

  • on an alignment attribute, it gives the number of aligned pairs.

The cqi_lexicon_size function indicates the number of different values of a positional attribute (number of types, or categories). It applies only to positional attributes.

The cqi_structural_attribute_has_values indicates if the specified attribute does have values. This concerns only the structural attributes. Positional attributes always have values. In order to get the value of a positionnal attribute with value, consider using cqi_struc2str.

The attribute argument is the qualified name of an attribute. This concerns any kind of attribute. The syntax is of the form name_of_corpus.name_of_attribute. For instance "DICKENS.lemma" (positional attribute) or "DICKENS.chapter" (structural attribute).

References

http://cwb.sourceforge.net/documentation.php

See Also

cqi_attributes, cqi_struc2str.

Examples

Run this code
# NOT RUN {
cqi_structural_attribute_has_values("DICKENS.file")
cqi_structural_attribute_has_values("DICKENS.file_name")
cqi_structural_attribute_has_values("DICKENS.chapter")
cqi_structural_attribute_has_values("DICKENS.chapter_title")

cqi_lexicon_size("DICKENS.lemma")
cqi_lexicon_size("DICKENS.pos")
cqi_lexicon_size("DICKENS.word")

# Positional attribute
cqi_attribute_size("DICKENS.lemma")
cqi_attribute_size("DICKENS.pos")
cqi_attribute_size("DICKENS.word")

# Structural attributes
cqi_attribute_size("DICKENS.book")
cqi_attribute_size("DICKENS.file")
cqi_attribute_size("DICKENS.chapter")
# }

Run the code above in your browser using DataLab