Adding attributes is based on mapping existing structure attributes onto the new ones – e.g case doc.id -> doc.region. The main script is called add_fields.sh and work as follows:

add_fields.sh [-m ] []

e.g. corpname=biwec, struct=doc, src_attr=id, new_attrname=region and tmpdir is path to a directory that is used for saving temporary data (/tmp by default). map_file is a name of the file with mapping from src_attr (e.g. doc.id) to new_attr (e.g. doc.gdex or doc.region) – the script expects a TAB-delimited text file with one pair of attributes on each line. The script creates encoded data for the new attribute and copies them in the right place; then, the config file has to be manually modified to add the new attribute.

The script codes are attached to this page – both files must be placed in the same directory before running add_fields.sh .

Script for adding header fields