Project

General

Profile

Map refactoring

Add back automapped mappings to map.csv

  1. Join map.csv onto src.csv:
    for map in inputs/*/*/src.csv; do (set -x; bin/in_place "$map" env quiet=1 bin/join "${map/%src.csv/map.csv}"); done
    
  2. Rename src.csv to map.csv:
    for map in inputs/*/*/src.csv; do (set -x; mv -f "$map" "${map/%src.csv/map.csv}"); done
    
  3. Restore original src.csvs:
    svn up
    
  4. Check that no rows have been removed:
    svn di|grep '^-'|grep -v '^---'
    
  5. make test
  6. Check diffs
  7. Commit

Change empty mappings to self mappings

  1. Join map.csv onto src.csv:
    for map in inputs/*/*/src.csv; do (set -x; bin/in_place "$map" env passthru=1 bin/join "${map/%src.csv/map.csv}"); done
    
  2. Rename src.csv to map.csv:
    for map in inputs/*/*/src.csv; do (set -x; mv -f "$map" "${map/%src.csv/map.csv}"); done
    
  3. Restore original src.csvs:
    svn up
    
  4. Check that no rows have been removed using svn di
  5. make test
  6. Check diffs
  7. Commit

Add filter column

  1. Insert filter column:
    for map in inputs/*/*/map.csv; do (set -x; bin/in_place "$map" bin/ins_col 2 Filter); done
    
  2. Change input.Makefile to combine the filter column with the output column before joining to create VegBIEN.csv
  3. make inputs/
  4. Check that no VegBIEN.csv have changed using svn st
  5. Check diffs
  6. Commit

Move filter suffixes to separate filter column

  1. Find mappings containing a filter expression:
    grep -lF /_ inputs/*/*/map.csv
    
  2. In each of these maps, move the /... suffix to the new Filter column:
    1. Replace regexp (/_.*?"), with ","$1
    2. Replace regexp (?<!["\d])(/_.*?), with ,$1
  3. make test
  4. Check diffs
  5. Commit

Add * to every term that's not in Veg+

  1. Change bin/src_map to prefix a * to every output column term
  2. Insert * column:
    for map in inputs/*/*/map.csv; do (set -x; bin/in_place "$map" bin/ins_col 1 VegCore "*"); done
    
  3. Combine prefix column with VegCore column:
    for map in inputs/*/*/map.csv; do (set -x; bin/in_place "$map" bin/cat_cols 1 2); done
    
  4. make test
  5. Check diffs
  6. Commit