Project

General

Profile

« Previous | Next » 

Revision 7484

mappings/Makefile, input.Makefile: Renamed $(dict) to $(thesaurus) because Veg+-VegCore.csv is actually a thesaurus, not a dictionary

View differences:

inputs/input.Makefile
147 147

  
148 148
vocab := $(mappings)/VegCore.csv
149 149
coreMap := $(mappings)/VegCore-VegBIEN.csv
150
dict := $(mappings)/Veg+-VegCore.csv
150
thesaurus := $(mappings)/Veg+-VegCore.csv
151 151

  
152 152
viaMaps := $(importTables:%=%/map.csv)
153 153

  
......
298 298

  
299 299
# Via maps cleanup
300 300
ifneq ($(filter %/.map.csv.last_cleanup,$(MAKECMDGOALS)),)
301
%/.map.csv.last_cleanup: %/map.csv $(vocab) $(dict) $(coreMap) $(srcDict)
301
%/.map.csv.last_cleanup: %/map.csv $(vocab) $(thesaurus) $(coreMap) $(srcDict)
302 302
	$(call translate,$(srcDict))
303 303
	$(bin)/in_place $< $(bin)/canon 1 $(vocab)
304
	$(call translate,$(dict))
304
	$(call translate,$(thesaurus))
305 305
	touch $@
306 306
	+$(selfMake) $(<:%/map.csv=%/unmapped_terms.csv)
307 307
	+$(selfMake) $(<:%/map.csv=%/new_terms.csv)
......
330 330
	tail -n +2 $<|$(bin)/cols 1|$(bin)/filter_out_ci 0 $(coreMap) >$@
331 331
	$(bin)/autoremove $@
332 332

  
333
%/new_terms.csv: %/map.csv $(vocab) $(dict) %/unmapped_terms.csv
333
%/new_terms.csv: %/map.csv $(vocab) $(thesaurus) %/unmapped_terms.csv
334 334
	$(newTerms)
335 335
	$(bin)/autoremove $@
336 336
newTerms = tail -n +2 $<|$(bin)/filter_out_ci 0 $(vocab)|$(bin)/filter_out_ci 0\
337
$(dict) $(if $(wildcard $(word 4,$+)),|$(bin)/filter_out_ci 0 $(word 4,$+))\
337
$(thesaurus) $(if $(wildcard $(word 4,$+)),|$(bin)/filter_out_ci 0 $(word 4,$+))\
338 338
|grep -vE -e '^"?:' -e 'UNUSED' >$@; exit 0 # grep exits nonzero if no match
339 339

  
340 340
termsSubdirs := $(importTables)
mappings/Makefile
10 10
bin := ../bin
11 11
inputCoreMaps := VegCore-VegBIEN.csv VegX-VegCore.csv
12 12
vocab := VegCore.csv
13
dict := Veg+-VegCore.csv
13
thesaurus := Veg+-VegCore.csv
14 14

  
15 15
##### General targets
16 16

  
17
all: _always $(vocab) $(dict) VegCore.tables.redmine $(inputCoreMaps) ;
17
all: _always $(vocab) $(thesaurus) VegCore.tables.redmine $(inputCoreMaps) ;
18 18

  
19 19
clean: _always
20 20
	$(RM) $(all)
......
30 30
	(echo VegCore; $(sed) -n 's/^.*<h[24][^>]*><a href="#[^>]*>(([a-z]|[A-Z]{2})[^<]*)<\/a><a href="#[^"-]+".*$$/\1/p'\
31 31
|sort -u) <$< >$@
32 32

  
33
$(dict): VegCore.htm
33
$(thesaurus): VegCore.htm
34 34
	(echo "Veg+,VegCore"; $(bin)/redmine_synonyms|grep -vE '^\??[A-Z][a-z]')\
35 35
<$< >$@
36 36
	# Canonicalize alternatives of ambiguous terms using unambiguous mappings
37
	$(bin)/in_place $@ $(bin)/translate 1 <(grep -vE '^\?' $(dict))
37
	$(bin)/in_place $@ $(bin)/translate 1 <(grep -vE '^\?' $(thesaurus))
38 38
	$(bin)/in_place $@ $(bin)/collapse_multimap
39 39
	# Replace ambiguous terms with alternatives lists
40
	$(bin)/in_place $@ $(bin)/translate 1 $(dict)
40
	$(bin)/in_place $@ $(bin)/translate 1 $(thesaurus)
41 41
	$(bin)/in_place $@ $(bin)/sort 0 1
42 42

  
43 43
VegCore.tables.csv: VegCore.htm
......
55 55

  
56 56
ifneq ($(filter .%.last_cleanup,$(MAKECMDGOALS)),)
57 57

  
58
.VegX-VegCore.csv.last_cleanup: .%.last_cleanup: % $(dict)
59
	$(bin)/in_place $< $(bin)/translate_ci 1 $(dict)
58
.VegX-VegCore.csv.last_cleanup: .%.last_cleanup: % $(thesaurus)
59
	$(bin)/in_place $< $(bin)/translate_ci 1 $(thesaurus)
60 60
	$(bin)/in_place $< $(bin)/sort 0 1
61 61
	touch $@
62 62
.PRECIOUS: .VegX-VegCore.csv.last_cleanup
63 63

  
64
.VegCore-VegBIEN.csv.last_cleanup: .%.last_cleanup: % $(dict) $(vocab)
65
	$(bin)/in_place $< $(bin)/translate_ci 0 $(dict)
64
.VegCore-VegBIEN.csv.last_cleanup: .%.last_cleanup: % $(thesaurus) $(vocab)
65
	$(bin)/in_place $< $(bin)/translate_ci 0 $(thesaurus)
66 66
	$(bin)/in_place $< $(bin)/canon 0 $(vocab)
67 67
	$(bin)/in_place $< $(bin)/sort_map
68 68
	touch $@

Also available in: Unified diff