Project

General

Profile

« Previous | Next » 

Revision 10255

bin/filter_out_ci, lib/maps.py: simplify(): also remove distinguishing #... suffix from terms (e.g. UNUSED#institutionID), to support mapping multiple columns to the special terms OMIT, PRIVATE, UNUSED (VegCore.vegpath.org#Special-terms), without creating a collision in the staging table renaming. note that this change must not be made to bin/canon, because this would cause suffixed terms to be autorenamed to their *un*suffixed VegCore versions.

View differences:

maps.py
48 48

  
49 49
##### Merging
50 50

  
51
def simplify(str_): return re.sub(r'[\W_]+', r'', str_.lower())
51
def simplify(str_): return re.sub(r'#.*$|[\W_]+', r'', str_.lower())
52 52

  
53 53
def is_nonexplicit_empty_mapping(row):
54 54
    return reduce(util.and_, (v == '' for v in row[1:]))

Also available in: Unified diff