Project

General

Profile

« Previous | Next » 

Revision 13747

schemas/VegBIEN/growth_forms/: moved into schemas/VegBIEN/planning/

View differences:

trunk/schemas/VegBIEN/growth_forms/Barbara_Dobrin.parsing.scripts/ScriptsAnnot/File5.sql
1
--### FILE5
2
--### Clean-up.  Returns selected records from bins to source table
3

  
4

  
5
--paramo, after stage4, before epiphytes BUT REALLY WHO CARES? lots of order changes already
6

  
7
insert into NSet select * from shrub2 where description regexp 'shrub(by)? paramo';
8
delete from shrub2 where recordID in (select recordID from NSet);
9
insert into NSet select * from shrub where description regexp '^[ \t]*[[:graph:]]+[ \t]+paramo';
10
delete from shrub where recordID in (select recordID from NSet);
11
insert into NSet select * from shrub3 where description regexp 'shrub(by)? paramo';
12
delete from  shrub3 where recordID in (select recordID from NSet);
13
insert into NSet select *  from shrub4 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4}paramo';
14
delete from  shrub4 where recordID in (select recordID from NSet);
15
insert into NSet select *   from grass4 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4}paramo';
16
delete    from grass4 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4}paramo';
17
insert into NSet select *   from grass3 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}paramo';
18
delete    from grass3 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}paramo';
19
insert into NSet select *    from grass2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}paramo';
20
delete    from grass2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}paramo';
21
insert into NSet select *     from grass where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}paramo';
22
delete from grass  where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}paramo';
23
insert into NSet select * from shrub4 where description regexp 'Fels, Erde, Mauer, Strauch|strauch-paramo';
24
delete from shrub4 where description regexp 'Fels, Erde, Mauer, Strauch|strauch-paramo';
25

  
26
--blechn
27
insert into NSet select * from shrub where description regexp 'blechnum-shrub assoc';
28
delete  from shrub where description regexp 'blechnum-shrub assoc';
29

  
30

  
31

  
32
---all this stuff done...5/3?  maybe should undo and take care of the paramos first
33

  
34
create table epiclimber select * From climber2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2,4}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
35
delete from  climber2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2,4}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
36
insert into epiclimber select * From climber where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
37
delete from climber where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
38

  
39
--herb
40
create table epiherb select * From herb where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
41
delete from  herb where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
42
insert into epiherb select * From herb2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
43
delete  From herb2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
44

  
45

  
46
--lian
47
create table epilian select * From lian where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
48
delete  From lian where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
49
insert into epilian select * From lian where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
50
delete From lian where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
51
insert into epilian select * From lian where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)' and not description regexp 'not hemi';
52
delete  From lian where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)' and not description regexp 'not hemi';
53
INSERT INTO epilian select * From lian2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2,}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
54
 delete  From lian2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2,}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
55

  
56
--moss
57
create table epimoss select * From moss where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
58
delete  From moss where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
59

  
60

  
61

  
62
--parasite
63
create table episite select * From parasit where description regexp '^[ \t]*([[:graph:]]+[ \t]+){0,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
64
delete From parasit where description regexp '^[ \t]*([[:graph:]]+[ \t]+){0,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
65

  
66

  
67

  
68

  
69

  
70

  
71

  
72

  
73

  
74

  
75

  
76
--vine
77
create table epivine select * From vins where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
78
 insert into epivine select * From vins where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
79
 insert into epivine select * From vins where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3,}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
80
delete  From vins where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1,}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
81
 insert into epivine select * From vine2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
82
delete from vine2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
83
 insert into epivine select * From vine2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
84
 delete  From vine2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
85

  
86

  
87

  
88

  
89
--shrub
90
create table epishrub select * From shrub2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
91
delete  From shrub2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
92
 insert into epishrub select * From shrub2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
93
delete  From shrub2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
94
insert into epishrub select * From shrub2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4,6}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
95
delete  From shrub2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4,6}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
96
insert into epishrub select * From shrub where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
97
alter table epishrub add index (recordID);
98
delete from shrub where recordID in (select recordID from epishrub);
99
insert into epishrub select * From shrub where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
100
delete  From shrub where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
101
insert into epishrub select * From shrub where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
102
delete  From shrub where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4,5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
103

  
104

  
105

  
106

  
107

  
108

  
109

  
110

  
111

  
112

  
113

  
114

  
115

  
116

  
117
--tree
118
create table treeepi select * From tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
119
alter table treeepi add index (recordID);
120
delete from tree where recordID in (select recordID from treeepi);
121
insert into treeepi select * From tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
122
 delete from  tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){2}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
123
insert into treeepi select * From tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)' and not description regexp 'with epi';
124
delete From tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)' and not description regexp 'with epi';
125
insert into treeepi select  * From tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4}(hemi|semi|sub)?-?epi(f|ph)(i|y)' and not description regexp 'with epi';
126
delete From tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4}(hemi|semi|sub)?-?epi(f|ph)(i|y)' and not description regexp 'with epi';
127
insert into treeepi select  * From tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
128
delete from tree where recordID in (select recordID from treeepi);
129
insert into treeepi select  * From tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){6}(hemi|semi|sub)?-?epi(f|ph)(i|y)' and not description regexp ' no epif';
130
delete   From tree where description regexp '^[ \t]*([[:graph:]]+[ \t]+){6}(hemi|semi|sub)?-?epi(f|ph)(i|y)' and not description regexp ' no epif';
131
insert into treeepi select * From tree2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
132
delete From tree2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){3}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
133
insert into treeepi select * From tree2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
134

  
135
delete  From tree2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){4}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
136
insert into treeepi select * From tree2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
137
delete  From tree2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){5}(hemi|semi|sub)?-?epi(f|ph)(i|y)';
138
insert into treeepi select * From tree3 where description regexp '^[ \t]*tree (like|trunk|limb)[ \t]+(hemi|semi|sub)?-?epi(f|ph)(i|y)';
139
delete From tree3 where description regexp '^[ \t]*tree (like|trunk|limb)[ \t]+(hemi|semi|sub)?-?epi(f|ph)(i|y)';
140

  
141

  
142 0

  
trunk/schemas/VegBIEN/growth_forms/Barbara_Dobrin.parsing.scripts/ScriptsAnnot/File6.sql
1
--###FILE6
2
--###Returns bad hits from bins to source table
3

  
4

  
5

  
6
---note how these are returned after already sorted
7

  
8

  
9
 insert into NSet select * from epi2prep;
10
 insert into NSet select * from epi4prep;
11

  
12
 /*
13
 insert into NSet select * from fern2prep;
14
 insert into NSet select * from fern3prep;
15
 insert into NSet select * from fern4prep;
16
 */
17
 
18
 insert into NSet select * from grass2prep;
19
 insert into NSet select * from grass3prep;
20
 insert into NSet select * from grass4prep;
21
 insert into NSet select * from herb2prep;
22
 insert into NSet select * from herb4prep;
23
 insert into NSet select * from lian2prep;
24
 insert into NSet select * from lian3prep;
25
 insert into NSet select * from lian4prep;
26
 insert into NSet select * from shrub2prep;
27
 insert into NSet select * from shrub3prep;
28
 insert into NSet select * from shrub4prep;
29
 insert into NSet select * from tree2prep;
30
 insert into NSet select * from tree3prep;
31

  
32
 insert into NSet select * from tree4prep;
33
 insert into NSet select * from vine2prep;
34
 insert into NSet select * from vine3prep;
35

  
36
insert into NSet select * from arborgroup;
37

  
38 0

  
trunk/schemas/VegBIEN/growth_forms/Barbara_Dobrin.parsing.scripts/ScriptsAnnot/File7.sql
1
--##File7
2
--##Consolidates bins down to 12, one for each habit
3

  
4

  
5
--make epi overall table
6
rename table epis to epi1;
7
create table epi select * from epi1;
8

  
9
insert into epi select * from epiherb;
10
insert into epi select * from epiclimber;
11
insert into epi select * from epilian;
12
insert into epi select * from epimoss;
13
insert into epi select * from epishrub;
14
insert into epi select * from episite;
15
insert into epi select * from epivine;
16
insert into epi select * from treeepi;
17
insert into  epi select * from epi2;
18
insert into  epi select * from epi3;
19
insert into  epi select * from epi4to6;
20

  
21
--climber
22
create table climber1 select * from climber;
23
insert into climber select * from climber2;
24
insert into climber select * from climber3;
25
insert into climber select * from climber4;
26

  
27
--erva
28
insert into herb select * from erva;
29
insert into herb select * from erva2;
30

  
31
--grass
32
create table grass1 select * from grass;
33
insert into  grass select * from grass2;
34
insert into  grass select * from grass3;
35
insert into  grass select * from grass4;
36

  
37
--herb
38
create table herb1 select * from herb;
39
insert into herb  select * from herb2;
40
insert into herb  select * from herb3;
41
insert into herb  select * from herb4;
42

  
43
--lian
44
create table lian1 select * from lian;
45
insert into lian select * from lian2;
46
insert into lian select * from lian3;
47
insert into lian select * from lian4;
48

  
49

  
50
--hyrdo
51
create table hydro1 select * from hydrophyte;
52
rename table hydrophyte to hydro;
53
insert into hydro select * from hydro2;
54

  
55
--paras
56
create table parasit1 select * from parasit;
57
insert into parasit select * from parasit2;
58

  
59

  
60
--shrub
61
create table shrub1 select * from shrub;
62
insert into shrub select * from shrub2;
63
insert into shrub select * from shrub3;
64
insert into shrub select * from shrub4;
65

  
66

  
67
--tree
68
create table tree1 select * from tree;
69
insert into tree select * from tree2;
70
insert into  tree select * from tree3;
71
insert into  tree select * from tree4;
72

  
73
--suff
74
create table suff1 select * from suffrut;
75
rename table suffrut to suff;
76
insert into suff select * from suff2;
77
insert into suff select * from suff3;
78
insert into suff select * from suff4;
79

  
80
--vine
81
create table vine1 select * from vins;
82
rename table vins to vine;
83
insert into vine select * from vine2;
84
insert into vine select * from vine3;
85 0

  
trunk/schemas/VegBIEN/growth_forms/Barbara_Dobrin.parsing.scripts/ScriptsAnnot/File1.sql
1
--##FILE1
2
--##Inspects word position #1 for keywords; bins hits by habit; removes hits from source table 
3

  
4

  
5
create table epis select * from NSet where description regexp '^[ \t]*[[:graph:]]*(sub|semi|hemi)*-?epi(f|ph)(i|y)';
6
alter table epis add index (recordID);
7
delete from NSet where recordID in (select recordID from epis);
8

  
9

  
10

  
11

  
12

  
13
create table lian select * from NSet where description regexp '^[[:punct:]0-9]*lian|[[:graph:]]*(cipo|bejuc)';
14
alter table lian add index (recordID);
15
delete from NSet where recordID in (select recordID from lian);
16

  
17

  
18

  
19
---create table ferns select * from NSet where description regexp '^[ \t]*[[:punct:]0-9]*((tree)?-?fern([[:>:]]|s)|helech)';
20
---alter table ferns add index (recordID);
21
---delete from NSet where recordID in (select recordID from ferns);
22

  
23

  
24

  
25
create table vins select * from NSet where description regexp '^[ \t]*[[:punct:]0-9]*((sub|grape|semi|bush)*-?vine|parra[[:>:]])';
26
alter table vins add index (recordID);
27
delete from NSet where recordID in (select recordID from vins);
28

  
29

  
30
create table grass  select * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}([[:punct:]0-9]*(grama|pasto|capim|graminoid|bamb(u|o))|[[:graph:]]*(grass|cesped|tussock|cespitosa|graminea)((es)|s)?[[:>:]])' and not description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:punct:]0-9]*bambucea';
31

  
32
--missing semicolons discovered 6-07; semicolons added 6-07
33
alter table grass add index (recordID);
34
delete from NSet where recordID in (select recordID from grass);
35

  
36

  
37

  
38

  
39
create table erva select * from NSet where description regexp '^[[:punct:]]*erva';
40
alter table erva add index (recordID);
41
delete from NSet where recordID in (select recordID from erva);
42

  
43

  
44
create table moss select * from NSet where description regexp '^[[:graph:]]*(moss|musgo)';
45

  
46
alter table moss add index (recordID);
47

  
48

  
49
delete from NSet where recordID in (select recordID from moss);
50

  
51

  
52
create table hydrophyte select * from NSet where description regexp '^[[:<:]]h(y|i)dro(f|p)';
53
alter table hydrophyte add index (recordID);
54
delete from NSet where recordID in (select recordID from hydrophyte);
55

  
56

  
57

  
58
create table herb select * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:graph:]]*herb(a|e|s)?c?' and not description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:graph:]]*herba(r|z)'  union select  * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}([[:<:]](hierb|yerba|kraut|forb)|[[:punct:]0-9]*(staude|geo(f|p)|liver|hepatic))';
59
alter table herb add index (recordID);
60
delete from NSet where recordID in (select recordID from herb);
61

  
62

  
63

  
64

  
65

  
66
--create table parasit select * from NSet where description  regexp '^[ \t]*[[:punct:]]*((s|h)?emi)*-?parasit';
67
  create table parasit select * from NSet where description  regexp '^[ \t]*[[:punct:]]*((s|h)?emi)*-?parasit' and not description regexp '^[ \t]*[[:punct:]]*((s|h)?emi)*-?parasitic (herb|shrub|strang|vine|lian)';
68
alter table parasit add index (recordID);
69
delete from NSet where recordID in (select recordID from parasit);
70

  
71

  
72
create table suffrut select * from NSet where description regexp '^[ \t]*[[:punct:]]*suf+ruc?t(e|i)';
73
alter table suffrut add index (recordID);
74
delete from NSet where recordID in (select recordID from suffrut);
75

  
76

  
77
create table climber select * from NSet where description regexp '^[ \t]*([[:graph:]]*-?(creep|climb)er|grimpante|plante rampante|[[:graph:]]*-?(trepad(o|ei)r|endredadera))' and not description regexp '^arbusto-(trepador|endredadera)|trepadores';
78
alter table climber add index (recordID);
79
delete from NSet where recordID in (select recordID from climber);
80

  
81

  
82

  
83
create table tree select * from NSet where description regexp '^[ \t]*[[:graph:]]*(palm(i|e|a)?(e|i)?(r|t)?|baum(ch|e|[[:>:]])|boom)' and not description regexp  '^[ \t]*[[:graph:]]*palmar' UNION select * from NSet where description regexp '^[ \t]*[[:punct:]0-9]*((citrus|semi|sub)*-?tree(let)?|arbre[[:>:]])' UNION select * from NSet where description regexp '^[ \t]*[[:punct:]0-9]*arbol' and not description regexp '^[ \t]*[[:punct:]0-9]*arbol(e|a)d(o|a)' UNION select * from NSet where description regexp '^[ \t]*[[:punct:]0-9]*[[:<:]]arvore[[:>:]]' UNION select * from NSet where description regexp '^[ \t]*[[:punct:]0-9]*(sapling|retono)';
84
alter table tree add index (recordID);
85
delete from NSet where recordID in (select recordID from tree);
86

  
87

  
88

  
89

  
90

  
91
create table shrub select * from NSet where description regexp '^[ \t]*([[:graph:]]*(shrub|arbrisseau|frijolillo|frutex)|(citrus|ranken|halb)*-?strauch|arvoreta|subfrutic)' or (description regexp '^[ \t]*(semi|sub)*-?arb(o|u)st[aeiou]*(v|n|t|l|c|f)*' and not description regexp '^[ \t]*(arbustal|starbust)');
92
alter table shrub add index (recordID);
93
delete from NSet where recordID in (select recordID from shrub);
94

  
95
create table arborgroup select * from NSet where description regexp '[[:<:]]arbore?(s|a|o)?[[:>:]]' ;
96
alter table arborgroup add index (recordID);
97
delete from NSet where recordID in (select recordID from arborgroup);
98

  
99 0

  
trunk/schemas/VegBIEN/growth_forms/Barbara_Dobrin.parsing.scripts/ScriptsAnnot/File2.sql
1
--##FILE2
2
--##Inspects word position #2 for keywords; bins hits by habit; removes hits from source table; removes "bad" hits from bins.  "Bad" = keyword is part of a prepositional predicate phrase   
3

  
4

  
5
--EPI -I
6
create table epi2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:graph:]]*(sub|semi|hemi)*-?epi(f|ph)(i|y)';
7
alter table epi2 add index (recordID);
8
delete from NSet where recordID in (select recordID from epi2);
9
--prep removal
10
create table epi2prep select * from epi2 where  description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:punct:]0-9]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|with(out)?)[ \t]+';
11
delete  from epi2 where  description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:punct:]0-9]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|with(out)?)[ \t]+';
12

  
13

  
14

  
15
--LIAN
16
create table lian2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+([[:punct:]]*lian|[[:graph:]]*cipo|[[:graph:]]*bejuc)';
17
alter table lian2 add index (recordID);
18
delete from NSet where recordID in (select recordID from lian2);
19
--prep removal
20
create table lian2prep select * from lian2 where  description regexp '^[ \t]*[[:punct:]]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|up|with(out)?)[ \t]+li';
21
alter table lian2prep add index (recordID);
22
delete from lian2 where recordID in (select recordID from lian2prep);
23
insert into lian2prep select * from lian2 where  description regexp '^[ \t]*[[:punct:]0-9]*(al|segun|sobre|partir|parte|desde|(en)?cima|en|dentro|(a|de)?bajo|lado|junto|cerca|entre|medio|traves|para)[ \t]+';
24
delete from  lian2 where  description regexp '^[ \t]*[[:punct:]0-9]*(al|segun|sobre|partir|parte|desde|(en)?cima|en|dentro|(a|de)?bajo|lado|junto|cerca|entre|medio|traves|para)[ \t]+';
25
insert into lian2prep select * from lian2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:punct:]0-9]*(sur|sous|par?-?(desso?us|derriere)?|aux?|des?|en(tre)?|portee|sommet|pres|le(s|z)?|devant|sans|avec|chez|dedans|hors|pour|proche)[ \t]+';
26
delete from  lian2 where description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:punct:]0-9]*(sur|sous|par?-?(desso?us|derriere)?|aux?|des?|en(tre)?|portee|sommet|pres|le(s|z)?|devant|sans|avec|chez|dedans|hors|pour|proche)[ \t]+';
27
delete from lian where recordID in (select recordID from lian2prep);
28
--FERN
29
---create table fern2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:punct:]0-9]*((tree)?-?fern([[:>:]]|s)|helech)';
30
---alter table fern2 add index (recordID);
31

  
32
---delete from NSet where recordID in (select recordID from fern2);
33
---insert into fern2 select * from tree  where description regexp '^[ \t]*[[:graph:]]*tree fern';
34
---delete from tree where recordID in (select recordID from fern2);
35
--prep removal
36
/*
37
---create table fern2prep select * from fern2 where  description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:punct:]]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|up|with(out)?)[ \t]+';
38
---delete from fern2  where  description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:punct:]]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|up|with(out)?)[ \t]+';
39
*/
40

  
41

  
42

  
43
--VINE
44
create table vine2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:punct:]0-9]*((sub|grape|semi|bush)*-?vine|parra[[:>:]])';
45
alter table vine2 add index (recordID);
46
delete from NSet where recordID in (select recordID from vine2);
47
--prep removal
48
create table vine2prep select * from vine2 where  description regexp '^[ \t]*[[:punct:]0-9]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|with(out)?)[ \t]+';
49
delete from vine2 where  description regexp '^[ \t]*[[:punct:]0-9]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|with(out)?)[ \t]+';
50

  
51

  
52

  
53

  
54
--grass
55

  
56
create table grass2  select * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}([[:punct:]0-9]*(grama|pasto|capim|graminoid|bamb(u|o))|[[:graph:]]*(grass|cesped|tussock|cespitosa|graminea)((es)|s)?[[:>:]])' and not description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}[[:punct:]0-9]*bambucea';
57
alter table grass2 add index (recordID);
58
delete from NSet where recordID in (select recordID from grass2);
59
--prep removal
60
create table grass2prep select * from grass2 where  description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:punct:]0-9]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|with(out)?)[ \t]+';
61
delete from  grass2 where  description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[[:punct:]0-9]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|with(out)?)[ \t]+';
62
insert into grass2prep select * from grass2 where  description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[1-9]*(al?|segun|sobre|partir|parte|desde|(en)?cima|en|dentro|(a|de)?bajo|lado|junto|cerca|entre|medio|de|traves|para)[ \t]+';
63
delete from grass2 where  description regexp '^[ \t]*([[:graph:]]+[ \t]+){0}[1-9]*(al?|segun|sobre|partir|parte|desde|(en)?cima|en|dentro|(a|de)?bajo|lado|junto|cerca|entre|medio|de|traves|para)[ \t]+';
64

  
65

  
66

  
67

  
68

  
69

  
70

  
71

  
72
--erva
73
create table erva2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:punct:]]*erva([[:>:]]|[^l])';
74
alter table erva2 add index (recordID);
75
delete from NSet where recordID in (select recordID from erva2);
76

  
77

  
78

  
79

  
80

  
81

  
82

  
83

  
84
--hydro
85
create table hydro2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:<:]]h(y|i)dro(f|p)';
86
alter table hydro2 add index (recordID);
87
delete from NSet where recordID in (select recordID from hydro2);
88

  
89
--HERB
90

  
91
create table herb2 select * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}[[:graph:]]*herb(a|e|s)?c?' and not description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}[[:graph:]]*herba(r|z)'  union select  * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}([[:<:]](hierb|yerba|kraut|forb)|[[:punct:]0-9]*(staude|geo(f|p)|liver|hepatic))';
92
alter table herb2 add index (recordID);
93
delete from NSet where recordID in (select recordID from herb2);
94

  
95
--prep removal
96
create table herb2prep select * from herb2 where  description regexp '^[ \t]*[[:punct:]0-9]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|up|with(out)?)[ \t]+';
97
delete from herb2 where  description regexp '^[ \t]*[[:punct:]0-9]*(on|in(to)?|under|beneath|beside|among(st)?|between|over|from|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|up|with(out)?)[ \t]+';
98

  
99

  
100

  
101

  
102

  
103

  
104

  
105

  
106

  
107

  
108

  
109
--PARASIT
110
--create table parasit2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:punct:]]*((s|h)?emi)*-?parasit';
111
 
112
 create table parasit2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:punct:]]*((s|h)?emi)*-?parasit' and not description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:punct:]]*((s|h)?emi)*-?parasitic (herb|shrub|strang|vine|lian)' ;
113
alter table parasit2  add index (recordID);
114
delete from NSet where recordID in (select recordID from parasit2);
115

  
116
--SUFF
117
create table suff2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:punct:]]*suf+ruc?t(e|i)';
118
alter table suff2 add index (recordID);
119
delete from NSet where recordID in (select recordID from suff2);
120

  
121
--CLIMBER
122
create table climber2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+([[:graph:]]*-?(creep|climb)er|grimpante|plante rampante|[[:graph:]]*-?(trepad(o|ei)r|endredadera))' and not description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:graph:]]*arbusto-(trepador|endredadera)|trepadores';
123
alter table climber2 add index (recordID);
124
delete from NSet where recordID in (select recordID from climber2);
125

  
126

  
127
--TREE
128

  
129

  
130
create table tree2 select * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}[[:graph:]]*(palm(i|e|a)?(e|i)?(r|t)?|baum(ch|e|[[:>:]])|boom)' and not description regexp  '^[ \t]*([[:graph:]]+[ \t]+){1}[[:graph:]]*palmar' UNION select * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}[[:punct:]0-9]*((citrus|semi|sub)*-?tree(let)?|arbre[[:>:]])' UNION select * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}[[:punct:]0-9]*arbol' and not description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}[[:punct:]0-9]*arbol(e|a)d(o|a)' UNION select * from NSet where description regexp '^[ \t]*([[:graph:]]+[ \t]+){1}[[:punct:]0-9]*([[:<:]]arvore[[:>:]]|sapling|retono)';
131
alter table tree2 add index (recordID);
132
delete from NSet where recordID in (select recordID from tree2);
133

  
134

  
135

  
136

  
137
--prep removal
138
 create table tree2prep select * from tree2 where  description regexp '^[ \t]*(on|in(to)?|under|beneath|beside|among(st)?|between|(on top )?of|(next )?to|by|near|opposite|along(side)?|amid|up|with(out)?)[ \t]+[[:graph:]]*((sub|citrus|semi)*-?tree|sapling|palm(e|a)?t?)';
139
alter table tree2prep add index (recordID);
140
delete from tree2 where recordID in (select recordID from tree2prep);
141
insert into tree2prep select * from tree2 where  description regexp '^[ \t]*(en|al?|segun|sobre|(en)?cima|dentro|(a|de)?bajo|lado|junto|cerca|entre|del?|medio)[ \t]+[[:punct:]]*[1-9]*arbol';
142
delete from tree2 where recordID in (select recordID from tree2prep);
143
insert into tree2prep select * from tree2 where description regexp '^[ \t]*(d(e|(o|a)?s?)|(n|pe)((o|a)?s?)|por|a(o|s)?debaixo|e|junto|atraves|sob(re?)|(a)?cerca|dentro|com|entre|(pert|lad)o|proximo|cima|apesar|meio|partir)[ \t]+[[:punct:]]*[[:<:]]arvore[[:>:]]';
144
delete from tree2 where recordID in (select recordID from tree2prep);
145
insert into tree2prep select * from tree2 where description regexp '^[ \t]*(i(n|m)|seit|auf|zur?|mit|unter|neben|zwischen|nah|bei|der|an)[ \t]+[[:punct:]]*[[:graph:]]*(baum)';
146
delete from tree2 where recordID in (select recordID from tree2prep);
147
insert into tree2prep select * from tree2 where description regexp 'au baum';
148
delete from tree2 where recordID in (select recordID from tree2prep);
149

  
150

  
151

  
152
insert into tree2prep select * from tree2 where description regexp '^[ \t]*[[:graph:]]*(climbing|creeping)[ \t]+';
153
delete from tree2 where recordID in (select recordID from tree2prep);
154

  
155

  
156
--SHRUB
157
create table shrub2 select * from NSet where description regexp '^[ \t]*[[:graph:]]+[ \t]+([[:graph:]]*(shrub|arbrisseau|frijolillo|frutex)|(citrus|ranken|halb)*-?strauch|arvoreta|subfrutic)'  or    (description regexp '^[ \t]*[[:graph:]]+[ \t]+[[:punct:]]*(semi|sub)*-?arb(o|u)st[aeiou]*(v|n|t|l|c|f)*' and not description regexp '^[ \t]*[[:graph:]]+[ \t]+(arbustal|starbust)');
158

  
159
alter table shrub2 add index (recordID);
160
delete from NSet where recordID in (select recordID from shrub2);
161

  
162
--prep removal
163
create table shrub2prep select * from shrub2 where description regexp '^[ \t]*(on|in|under|beneath|beside|among(st)?|between|on top of|next to|by|near|opposite|alongside|amid)[ \t]+[[:graph:]]*shrub';
164
alter table shrub2prep add index (recordID);
165
delete from shrub2 where recordID in (select recordID from shrub2prep);
166
insert into shrub2prep select * from shrub2 where description regexp '^[ \t]*(en|al|segun|sobre|(en)?cima|dentro|(a|de)?bajo|lado|junto|cerca|entre|del?|medio)[ \t]+[[:graph:]]*(frijolillo|frutex|subfrutic)'  or    description regexp '^[ \t]*(en|al|segun|sobre|(en)?cima|dentro|(a|de)?bajo|lado|junto|cerca|entre|del?|medio)[ \t]+[[:punct:]]*(semi|sub)*-?arb(o|u)st[aeiou]*(v|n|t|l|c|f)*'; 
167
delete from shrub2 where recordID in (select recordID from shrub2prep);
168
insert into shrub2prep select * from shrub2 where description regexp '^[ \t]*(i(n|m)|seit|auf|zur?|mit|unter|neben|zwischen|nah|bei|der|an)[[ \t]+[[:graph:]]*(citrus|ranken|halb)*-?strauch';
169
delete from shrub2 where recordID in (select recordID from shrub2prep);
170

  
171

  
172

  
173

  
174

  
175

  
176

  
177

  
178

  
179

  
180

  
181

  
182

  
183

  
184

  
185

  
186

  
187

  
188

  
189

  
190

  
191

  
192

  
193

  
194

  
195

  
196

  
197

  
198

  
199

  
200

  
201

  
202

  
203

  
204

  
205

  
206

  
207

  
208

  
209

  
210

  
211

  
212

  
213

  
214

  
215

  
216

  
217

  
218

  
219

  
220

  
221

  
222

  
223

  
224

  
225

  
226

  
227

  
228

  
229

  
230

  
231

  
232

  
233

  
234

  
235

  
236

  
237

  
238

  
239

  
240

  
241

  
242

  
243

  
244

  
245

  
246

  
247

  
248

  
249

  
250

  
251

  
252

  
253

  
254

  
255

  
256

  
257

  
258

  
259

  
260

  
261

  
262

  
263

  
264

  
265

  
266

  
267

  
268

  
269

  
270

  
271

  
272

  
273

  
274

  
275

  
276

  
277

  
278

  
279

  
280

  
281

  
282

  
283

  
284

  
285

  
286

  
287

  
288

  
289

  
290

  
291

  
292

  
293

  
294

  
295

  
296

  
297

  
298

  
299

  
300

  
301

  
302

  
303

  
304

  
305

  
306

  
307

  
308

  
309

  
310

  
311

  
312

  
313

  
314

  
315

  
316

  
317

  
318

  
319

  
320

  
321

  
322

  
323

  
324

  
325

  
326

  
327

  
328

  
329

  
330

  
331

  
332

  
333

  
334

  
335

  
336

  
337

  
338

  
339

  
340

  
341

  
342

  
343

  
344

  
345

  
346

  
347

  
348

  
349

  
350

  
351

  
352

  
353

  
354

  
355

  
356

  
357

  
358

  
359

  
360

  
361

  
362

  
363

  
364

  
365

  
366

  
367

  
368

  
369

  
370

  
371

  
372

  
373

  
374

  
375

  
376

  
377

  
378

  
379

  
380

  
381

  
382

  
383

  
384

  
385

  
386

  
387

  
388

  
389

  
390

  
391

  
392

  
393

  
394

  
395

  
396

  
397

  
398

  
399

  
400

  
401

  
402

  
403

  
404

  
405

  
406

  
407

  
408

  
409

  
410

  
411

  
412

  
413

  
414

  
415

  
416

  
417

  
418

  
419

  
420

  
421

  
422

  
423

  
424

  
425

  
426

  
427

  
428

  
429

  
430

  
431

  
432

  
433

  
434

  
435

  
436

  
437

  
438

  
439

  
440

  
441

  
442

  
443

  
444

  
445

  
446

  
447

  
448

  
449

  
450

  
451

  
452

  
453

  
454

  
455

  
456

  
457

  
458

  
459

  
460

  
461

  
462

  
463

  
464

  
465

  
466

  
467

  
468

  
469

  
470

  
471

  
472

  
473

  
474

  
475

  
476

  
477

  
478

  
479

  
480

  
481

  
482

  
483

  
484

  
485

  
486

  
487

  
488

  
489

  
490

  
491

  
492

  
493

  
494

  
495

  
496

  
497

  
498

  
499

  
500

  
501

  
502

  
503

  
504

  
505

  
506

  
507

  
508

  
509

  
510

  
511

  
512

  
513

  
514

  
515

  
516

  
517

  
518

  
519

  
520

  
521

  
522

  
523

  
524

  
525

  
526

  
527

  
528

  
529

  
530

  
531

  
532

  
533

  
534

  
535

  
536

  
537

  
538

  
539

  
540

  
541

  
542

  
543

  
544

  
545

  
546

  
547

  
548

  
549

  
550

  
551

  
552

  
553

  
554

  
555

  
556

  
557

  
558

  
559

  
560

  
561

  
562

  
563

  
564

  
565

  
566

  
567

  
568

  
569

  
570

  
571

  
572

  
573

  
574

  
575

  
576

  
577

  
578

  
579

  
580

  
581

  
582

  
583

  
584

  
585

  
586

  
587

  
588

  
589

  
590

  
591

  
592

  
593

  
594

  
595

  
596

  
597

  
598

  
599

  
600

  
601

  
602

  
603

  
604

  
605

  
606

  
607

  
608

  
609

  
610

  
611

  
612

  
613

  
614

  
615

  
616

  
617

  
618

  
619

  
620

  
621

  
622

  
623

  
624

  
625

  
626

  
627

  
628

  
629

  
630

  
631

  
632

  
633

  
634

  
635

  
636

  
637

  
638

  
639

  
640

  
641

  
642

  
643

  
644

  
645

  
646

  
647

  
648

  
649

  
650

  
651

  
652

  
653

  
654

  
655

  
656

  
657

  
658

  
659

  
660

  
661

  
662

  
663

  
664

  
665

  
666

  
667

  
668

  
669

  
670

  
671

  
672

  
673

  
674

  
675

  
676

  
677

  
678

  
679

  
680

  
681

  
682

  
683

  
684

  
685

  
686

  
687

  
688

  
689

  
690

  
691

  
692

  
693

  
694

  
695

  
696

  
697

  
698

  
699

  
700

  
701

  
702

  
703

  
704

  
705

  
706

  
707

  
708

  
709

  
710

  
711

  
712

  
713

  
714

  
715

  
716

  
717

  
718

  
719

  
720

  
721

  
722

  
723

  
724

  
725

  
726

  
727

  
728

  
729

  
730

  
731

  
732

  
733

  
734

  
735

  
736

  
737

  
738

  
739

  
740

  
741

  
742

  
743

  
744

  
745

  
746

  
747

  
748

  
749

  
750

  
751

  
752

  
753

  
754

  
755

  
756

  
757

  
758

  
759

  
760

  
761

  
762

  
763

  
764

  
765

  
766

  
767

  
768

  
769

  
770

  
771

  
772

  
773

  
774

  
775

  
776

  
777

  
778

  
779

  
780

  
781

  
782

  
783

  
784

  
785

  
786

  
787

  
788

  
789

  
790

  
791

  
792

  
793

  
794

  
795

  
796

  
797

  
798

  
799

  
800

  
801

  
802

  
803

  
804

  
805

  
806

  
807

  
808

  
809

  
810

  
811

  
812

  
813

  
814

  
815

  
816

  
817

  
818

  
819

  
820

  
821

  
822

  
823

  
824

  
825

  
826

  
827

  
828

  
829

  
830

  
831

  
832

  
833

  
834

  
835

  
836

  
837

  
838

  
839

  
840

  
841

  
842

  
843

  
844

  
845

  
846

  
847

  
848

  
849

  
850

  
851

  
852

  
853

  
854

  
855

  
856

  
857

  
858

  
859

  
860

  
861

  
862

  
863

  
864

  
865

  
866

  
867

  
868

  
869

  
870

  
871

  
872

  
873

  
874

  
875

  
876

  
877

  
878

  
879

  
880

  
881

  
882

  
883

  
884

  
885

  
886

  
887

  
888

  
889

  
890

  
891

  
892

  
893

  
894

  
895

  
896

  
897

  
898

  
899

  
900

  
901

  
902

  
903

  
904

  
905

  
906

  
907

  
908

  
909

  
910

  
911

  
912

  
913

  
914

  
915

  
916

  
917

  
918

  
919

  
920

  
921

  
922

  
923

  
924

  
925

  
926

  
927

  
928

  
929

  
930

  
931

  
932

  
933

  
934

  
935

  
936

  
937

  
938

  
939

  
940

  
941

  
942

  
943

  
944

  
945

  
946

  
947

  
948

  
949

  
950

  
951

  
952

  
953

  
954

  
955

  
956

  
957

  
958

  
959

  
960

  
961

  
962

  
963

  
964

  
965

  
966

  
967

  
968

  
969

  
970

  
971

  
972

  
973

  
974

  
975

  
976

  
977

  
978

  
979

  
980

  
981

  
982

  
983

  
984

  
985

  
986

  
987

  
988

  
989

  
990

  
991

  
992

  
993

  
994

  
995

  
996

  
997

  
998

  
999

  
1000

  
1001

  
1002

  
1003

  
1004

  
1005

  
1006

  
1007

  
1008

  
1009

  
1010

  
1011

  
1012

  
1013

  
1014

  
1015

  
1016

  
1017

  
1018

  
1019

  
1020

  
1021

  
1022

  
1023

  
1024

  
1025

  
1026

  
1027

  
1028

  
1029

  
1030

  
1031

  
1032

  
1033

  
1034

  
1035

  
1036

  
1037

  
1038

  
1039

  
1040

  
1041

  
1042

  
1043

  
1044

  
1045

  
1046

  
1047

  
1048

  
1049

  
1050

  
1051

  
1052

  
1053

  
1054

  
1055

  
1056

  
1057

  
1058

  
1059

  
1060

  
1061

  
1062

  
1063

  
1064

  
1065

  
1066

  
1067

  
1068

  
1069

  
1070

  
1071

  
1072

  
1073

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff