AlvisNLP

corpus processing engine

TabularReader

Synopsis

Reads a tabular file and applies actions for each line.

Description

TabularReader reads source as a tabular file and for each line evaluates each lineActions .

Snippet

<tabularreader class="TabularReader">
    <lineActions></lineActions>
    <source></source>
    <sourceElement></sourceElement>
</tabularreader>

Mandatory parameters

lineActions

Mandatory

Action expressions to evaluate at each row. The expressions are evaluated from the element specified by sourceElement .

The library tab defines the following functions:

source

Mandatory

Source of CSV. Maybe a path to a file or an URL

sourceElement

Mandatory
Type: Expression

For each source, this expression is evaluated as a single element from the corpus. lineActions will be evaluated from this element.

Optional parameters

checkNumColumns

Optional
Type: Integer

Either to check that all rows have the same number of columns. The execution will fail if one row has a wrong number of columns.

constantAnnotationFeatures

Optional
Type: Mapping

Constant features to add to each annotation created by this module.

constantDocumentFeatures

Optional
Type: Mapping

Constant features to add to each document created by this module.

constantRelationFeatures

Optional
Type: Mapping

Constant features to add to each relation created by this module.

constantSectionFeatures

Optional
Type: Mapping

Constant features to add to each section created by this module.

constantTupleFeatures

Optional
Type: Mapping

Constant features to add to each tuple created by this module.

addToLayer

Default value: `false`
Type: Boolean

Allow to add annotations to layers.

commitLines

Default value: `false`
Type: Boolean

Commit changes at each line.

createAnnotations

Default value: `false`
Type: Boolean

Allow the creation of annotations.

createDocuments

Default value: `false`
Type: Boolean

Allow the creation of documents.

createRelations

Default value: `false`
Type: Boolean

Allow the creation of relations.

createSections

Default value: `false`
Type: Boolean

Allow the creation of sections.

createTuples

Default value: `false`
Type: Boolean

Allow to create tuples.

deleteElements

Default value: `false`
Type: Boolean

Allow to delete elements.

Default value: `false`
Type: Boolean

Either to skip the first row.

removeFromLayer

Default value: `false`
Type: Boolean

Allow to remove annotations from layers.

separator

Default value: ` `
Type: Character

Column separator character.

setArguments

Default value: `false`
Type: Boolean

Allow to set tuple arguments.

setFeatures

Default value: `false`
Type: Boolean

Allow to set element features.

skipBlank

Default value: `false`
Type: Boolean

Either to skip blank lines.

trimColumns

Default value: `true`
Type: Boolean

Either to trim values from leading and trailing whitespace

trueCSV

Default value: `false`
Type: Boolean

Use CSV Commons library (handles quoted values).

Deprecated parameters