AlvisNLP

corpus processing engine

FileMapper

Synopsis

Maps elements according to a tab-separated mapping file.

Description

FileMapper reads the tab-separated mapping file mappingFile and maps the elements specified by the expression target . The mapping key of the elements is specified by the expression form evaluated as a string with the element as the context. The key is mapped agains the column of mappingFile specified by keyColumn (starting at 0). Each feature in targetFeatures is set with the value of the corresponding column in the matched line.

Snippet

<filemapper class="FileMapper">
    <form></form>
    <mappingFile></mappingFile>
    <target></target>
</filemapper>

Mandatory parameters

form

Mandatory
Type: Expression

Expression evaluated as a string with the target element as context that specifies the target key.

mappingFile

Mandatory

Tab-separated file containing the dictionary.

target

Mandatory
Type: Expression

Expression evaluated as a list of elements with the corpus as context that specify the elements to be mapped.

Optional parameters

targetFeatures

Optional
Type: String[]

Name of the features where to store the columns of matched lines. Ignored if headerLine is set.

headerLine

Default value: `false`
Type: Boolean

Assumes the first line of the dictionary is a header, target feature names will be the column names read from the header.

ignoreCase

Default value: `false`
Type: Boolean

Either to match ignoring the case.

keyColumn

Default value: `0`
Type: Integer

Index of the line key in mappingFile .

operator

Default value: `exact`

Matching operator: either exact (default) or prefix.

separator

Default value: ` `
Type: Character

Separator character between columns in mappingFile .

Deprecated parameters