biodiversity 3.4.4 → 3.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/biodiversity/parser/scientific_name_clean.rb +685 -298
- data/lib/biodiversity/parser/scientific_name_clean.treetop +87 -6
- data/lib/biodiversity/version.rb +1 -1
- data/spec/files/test_data.txt +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99edee1b765669b47d847c7090c27fa71ec58053
|
4
|
+
data.tar.gz: 99a11c908b706645f022aa28dd37a8fad1144840
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9117a52f0a37706fa550c824681d9ad9cf5cd1da588aaccf18d99f01c100238f2b39ebc6a2cbc619b32ba2a2cbcd7ffae1e4fcef51e1ac298cc5c92c0d222598
|
7
|
+
data.tar.gz: d504f616fdd5eb73bd9e201d06bca12846b6c0c4f21a9df0c734ad8a8e8b2478ddef01e4ea5a9af045e16809e3d6b9308c56c3caaec10b1cfa534679da8e82fb
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
3.4.5 -- fix "fil." and "filius" with infraspecies after them, add "'t" as a
|
2
|
+
possible author prefix, add "emend." as "emendatum or rectified by" to
|
3
|
+
authors
|
4
|
+
|
1
5
|
3.4.4 -- support "del" as part of authorship, do not truncate epithets that
|
2
6
|
start with "nomen", add "nvar." as a rank
|
3
7
|
|
@@ -3861,11 +3861,11 @@ module ScientificNameClean
|
|
3861
3861
|
end
|
3862
3862
|
|
3863
3863
|
def space2
|
3864
|
-
elements[
|
3864
|
+
elements[3]
|
3865
3865
|
end
|
3866
3866
|
|
3867
3867
|
def c
|
3868
|
-
elements[
|
3868
|
+
elements[4]
|
3869
3869
|
end
|
3870
3870
|
end
|
3871
3871
|
|
@@ -3944,6 +3944,37 @@ module ScientificNameClean
|
|
3944
3944
|
end
|
3945
3945
|
end
|
3946
3946
|
|
3947
|
+
module Authorship8
|
3948
|
+
def a
|
3949
|
+
elements[0]
|
3950
|
+
end
|
3951
|
+
|
3952
|
+
def space
|
3953
|
+
elements[1]
|
3954
|
+
end
|
3955
|
+
|
3956
|
+
def b
|
3957
|
+
elements[2]
|
3958
|
+
end
|
3959
|
+
end
|
3960
|
+
|
3961
|
+
module Authorship9
|
3962
|
+
def value
|
3963
|
+
a.value + " " + b.value
|
3964
|
+
end
|
3965
|
+
|
3966
|
+
def pos
|
3967
|
+
a.pos.merge(b.pos)
|
3968
|
+
end
|
3969
|
+
|
3970
|
+
def details
|
3971
|
+
val = a.details
|
3972
|
+
val[:authorship] = text_value.strip
|
3973
|
+
val[:basionymAuthorTeam].merge!(b.details)
|
3974
|
+
val
|
3975
|
+
end
|
3976
|
+
end
|
3977
|
+
|
3947
3978
|
def _nt_authorship
|
3948
3979
|
start_index = index
|
3949
3980
|
if node_cache[:authorship].has_key?(index)
|
@@ -4012,26 +4043,11 @@ module ScientificNameClean
|
|
4012
4043
|
r12 = _nt_simple_authorship
|
4013
4044
|
s9 << r12
|
4014
4045
|
if r12
|
4015
|
-
|
4016
|
-
r14 = true
|
4017
|
-
@index += match_len
|
4018
|
-
else
|
4019
|
-
terminal_parse_failure('","')
|
4020
|
-
r14 = nil
|
4021
|
-
end
|
4022
|
-
if r14
|
4023
|
-
r13 = r14
|
4024
|
-
else
|
4025
|
-
r13 = instantiate_node(SyntaxNode,input, index...index)
|
4026
|
-
end
|
4046
|
+
r13 = _nt_space
|
4027
4047
|
s9 << r13
|
4028
4048
|
if r13
|
4029
|
-
|
4030
|
-
s9 <<
|
4031
|
-
if r15
|
4032
|
-
r16 = _nt_ex_authorship
|
4033
|
-
s9 << r16
|
4034
|
-
end
|
4049
|
+
r14 = _nt_emend_authorship
|
4050
|
+
s9 << r14
|
4035
4051
|
end
|
4036
4052
|
end
|
4037
4053
|
end
|
@@ -4048,79 +4064,103 @@ module ScientificNameClean
|
|
4048
4064
|
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
4049
4065
|
r0 = r9
|
4050
4066
|
else
|
4051
|
-
|
4052
|
-
|
4053
|
-
|
4054
|
-
if
|
4055
|
-
|
4056
|
-
|
4057
|
-
if
|
4058
|
-
|
4059
|
-
|
4067
|
+
i15, s15 = index, []
|
4068
|
+
r16 = _nt_basionym_authorship_with_parenthesis
|
4069
|
+
s15 << r16
|
4070
|
+
if r16
|
4071
|
+
r17 = _nt_space
|
4072
|
+
s15 << r17
|
4073
|
+
if r17
|
4074
|
+
r18 = _nt_simple_authorship
|
4075
|
+
s15 << r18
|
4060
4076
|
end
|
4061
4077
|
end
|
4062
|
-
if
|
4063
|
-
|
4064
|
-
|
4065
|
-
|
4078
|
+
if s15.last
|
4079
|
+
r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
|
4080
|
+
r15.extend(Authorship4)
|
4081
|
+
r15.extend(Authorship5)
|
4066
4082
|
else
|
4067
|
-
@index =
|
4068
|
-
|
4083
|
+
@index = i15
|
4084
|
+
r15 = nil
|
4069
4085
|
end
|
4070
|
-
if
|
4071
|
-
|
4072
|
-
r0 =
|
4086
|
+
if r15
|
4087
|
+
r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
|
4088
|
+
r0 = r15
|
4073
4089
|
else
|
4074
|
-
|
4075
|
-
if
|
4076
|
-
|
4077
|
-
r0 =
|
4090
|
+
r19 = _nt_basionym_authorship_with_parenthesis
|
4091
|
+
if r19
|
4092
|
+
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
4093
|
+
r0 = r19
|
4078
4094
|
else
|
4079
|
-
|
4080
|
-
|
4081
|
-
|
4082
|
-
if
|
4095
|
+
i20, s20 = index, []
|
4096
|
+
r21 = _nt_simple_authorship
|
4097
|
+
s20 << r21
|
4098
|
+
if r21
|
4083
4099
|
if (match_len = has_terminal?(",", false, index))
|
4084
|
-
|
4100
|
+
r23 = true
|
4085
4101
|
@index += match_len
|
4086
4102
|
else
|
4087
4103
|
terminal_parse_failure('","')
|
4088
|
-
|
4104
|
+
r23 = nil
|
4089
4105
|
end
|
4090
|
-
if
|
4091
|
-
|
4106
|
+
if r23
|
4107
|
+
r22 = r23
|
4092
4108
|
else
|
4093
|
-
|
4109
|
+
r22 = instantiate_node(SyntaxNode,input, index...index)
|
4094
4110
|
end
|
4095
|
-
|
4096
|
-
if
|
4097
|
-
|
4098
|
-
|
4099
|
-
if
|
4100
|
-
|
4101
|
-
|
4111
|
+
s20 << r22
|
4112
|
+
if r22
|
4113
|
+
r24 = _nt_space
|
4114
|
+
s20 << r24
|
4115
|
+
if r24
|
4116
|
+
r25 = _nt_ex_authorship
|
4117
|
+
s20 << r25
|
4102
4118
|
end
|
4103
4119
|
end
|
4104
4120
|
end
|
4105
|
-
if
|
4106
|
-
|
4107
|
-
|
4108
|
-
|
4121
|
+
if s20.last
|
4122
|
+
r20 = instantiate_node(SyntaxNode,input, i20...index, s20)
|
4123
|
+
r20.extend(Authorship6)
|
4124
|
+
r20.extend(Authorship7)
|
4109
4125
|
else
|
4110
|
-
@index =
|
4111
|
-
|
4126
|
+
@index = i20
|
4127
|
+
r20 = nil
|
4112
4128
|
end
|
4113
|
-
if
|
4114
|
-
|
4115
|
-
r0 =
|
4129
|
+
if r20
|
4130
|
+
r20 = SyntaxNode.new(input, (index-1)...index) if r20 == true
|
4131
|
+
r0 = r20
|
4116
4132
|
else
|
4117
|
-
|
4118
|
-
|
4119
|
-
|
4120
|
-
|
4133
|
+
i26, s26 = index, []
|
4134
|
+
r27 = _nt_simple_authorship
|
4135
|
+
s26 << r27
|
4136
|
+
if r27
|
4137
|
+
r28 = _nt_space
|
4138
|
+
s26 << r28
|
4139
|
+
if r28
|
4140
|
+
r29 = _nt_emend_authorship
|
4141
|
+
s26 << r29
|
4142
|
+
end
|
4143
|
+
end
|
4144
|
+
if s26.last
|
4145
|
+
r26 = instantiate_node(SyntaxNode,input, i26...index, s26)
|
4146
|
+
r26.extend(Authorship8)
|
4147
|
+
r26.extend(Authorship9)
|
4121
4148
|
else
|
4122
|
-
@index =
|
4123
|
-
|
4149
|
+
@index = i26
|
4150
|
+
r26 = nil
|
4151
|
+
end
|
4152
|
+
if r26
|
4153
|
+
r26 = SyntaxNode.new(input, (index-1)...index) if r26 == true
|
4154
|
+
r0 = r26
|
4155
|
+
else
|
4156
|
+
r30 = _nt_simple_authorship
|
4157
|
+
if r30
|
4158
|
+
r30 = SyntaxNode.new(input, (index-1)...index) if r30 == true
|
4159
|
+
r0 = r30
|
4160
|
+
else
|
4161
|
+
@index = i0
|
4162
|
+
r0 = nil
|
4163
|
+
end
|
4124
4164
|
end
|
4125
4165
|
end
|
4126
4166
|
end
|
@@ -4247,12 +4287,59 @@ module ScientificNameClean
|
|
4247
4287
|
elements[3]
|
4248
4288
|
end
|
4249
4289
|
|
4250
|
-
def
|
4290
|
+
def b
|
4251
4291
|
elements[4]
|
4252
4292
|
end
|
4293
|
+
|
4294
|
+
def space3
|
4295
|
+
elements[5]
|
4296
|
+
end
|
4297
|
+
|
4298
|
+
def right_paren
|
4299
|
+
elements[6]
|
4300
|
+
end
|
4253
4301
|
end
|
4254
4302
|
|
4255
4303
|
module BasionymAuthorshipWithParenthesis5
|
4304
|
+
def value
|
4305
|
+
"(" + a.value + " " + b.value + ")"
|
4306
|
+
end
|
4307
|
+
|
4308
|
+
def pos
|
4309
|
+
a.pos.merge(b.pos)
|
4310
|
+
end
|
4311
|
+
|
4312
|
+
def details
|
4313
|
+
val = a.details
|
4314
|
+
val[:basionymAuthorTeam].merge!(b.details)
|
4315
|
+
val[:authorship] = text_value.strip
|
4316
|
+
val
|
4317
|
+
end
|
4318
|
+
end
|
4319
|
+
|
4320
|
+
module BasionymAuthorshipWithParenthesis6
|
4321
|
+
def left_paren
|
4322
|
+
elements[0]
|
4323
|
+
end
|
4324
|
+
|
4325
|
+
def space1
|
4326
|
+
elements[1]
|
4327
|
+
end
|
4328
|
+
|
4329
|
+
def a
|
4330
|
+
elements[2]
|
4331
|
+
end
|
4332
|
+
|
4333
|
+
def space2
|
4334
|
+
elements[3]
|
4335
|
+
end
|
4336
|
+
|
4337
|
+
def right_paren
|
4338
|
+
elements[4]
|
4339
|
+
end
|
4340
|
+
end
|
4341
|
+
|
4342
|
+
module BasionymAuthorshipWithParenthesis7
|
4256
4343
|
def value
|
4257
4344
|
"(" + a.value + ")"
|
4258
4345
|
end
|
@@ -4268,7 +4355,7 @@ module ScientificNameClean
|
|
4268
4355
|
end
|
4269
4356
|
end
|
4270
4357
|
|
4271
|
-
module
|
4358
|
+
module BasionymAuthorshipWithParenthesis8
|
4272
4359
|
def left_paren
|
4273
4360
|
elements[0]
|
4274
4361
|
end
|
@@ -4290,7 +4377,7 @@ module ScientificNameClean
|
|
4290
4377
|
end
|
4291
4378
|
end
|
4292
4379
|
|
4293
|
-
module
|
4380
|
+
module BasionymAuthorshipWithParenthesis9
|
4294
4381
|
def value
|
4295
4382
|
"(?)"
|
4296
4383
|
end
|
@@ -4441,8 +4528,16 @@ module ScientificNameClean
|
|
4441
4528
|
r26 = _nt_space
|
4442
4529
|
s22 << r26
|
4443
4530
|
if r26
|
4444
|
-
r27 =
|
4531
|
+
r27 = _nt_emend_authorship
|
4445
4532
|
s22 << r27
|
4533
|
+
if r27
|
4534
|
+
r28 = _nt_space
|
4535
|
+
s22 << r28
|
4536
|
+
if r28
|
4537
|
+
r29 = _nt_right_paren
|
4538
|
+
s22 << r29
|
4539
|
+
end
|
4540
|
+
end
|
4446
4541
|
end
|
4447
4542
|
end
|
4448
4543
|
end
|
@@ -4459,45 +4554,77 @@ module ScientificNameClean
|
|
4459
4554
|
r22 = SyntaxNode.new(input, (index-1)...index) if r22 == true
|
4460
4555
|
r0 = r22
|
4461
4556
|
else
|
4462
|
-
|
4463
|
-
|
4464
|
-
|
4465
|
-
if
|
4466
|
-
|
4467
|
-
|
4468
|
-
if
|
4469
|
-
|
4470
|
-
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4475
|
-
|
4476
|
-
|
4477
|
-
if r31
|
4478
|
-
r32 = _nt_space
|
4479
|
-
s28 << r32
|
4480
|
-
if r32
|
4481
|
-
r33 = _nt_right_paren
|
4482
|
-
s28 << r33
|
4557
|
+
i30, s30 = index, []
|
4558
|
+
r31 = _nt_left_paren
|
4559
|
+
s30 << r31
|
4560
|
+
if r31
|
4561
|
+
r32 = _nt_space
|
4562
|
+
s30 << r32
|
4563
|
+
if r32
|
4564
|
+
r33 = _nt_simple_authorship
|
4565
|
+
s30 << r33
|
4566
|
+
if r33
|
4567
|
+
r34 = _nt_space
|
4568
|
+
s30 << r34
|
4569
|
+
if r34
|
4570
|
+
r35 = _nt_right_paren
|
4571
|
+
s30 << r35
|
4483
4572
|
end
|
4484
4573
|
end
|
4485
4574
|
end
|
4486
4575
|
end
|
4487
|
-
if
|
4488
|
-
|
4489
|
-
|
4490
|
-
|
4576
|
+
if s30.last
|
4577
|
+
r30 = instantiate_node(SyntaxNode,input, i30...index, s30)
|
4578
|
+
r30.extend(BasionymAuthorshipWithParenthesis6)
|
4579
|
+
r30.extend(BasionymAuthorshipWithParenthesis7)
|
4491
4580
|
else
|
4492
|
-
@index =
|
4493
|
-
|
4581
|
+
@index = i30
|
4582
|
+
r30 = nil
|
4494
4583
|
end
|
4495
|
-
if
|
4496
|
-
|
4497
|
-
r0 =
|
4584
|
+
if r30
|
4585
|
+
r30 = SyntaxNode.new(input, (index-1)...index) if r30 == true
|
4586
|
+
r0 = r30
|
4498
4587
|
else
|
4499
|
-
|
4500
|
-
|
4588
|
+
i36, s36 = index, []
|
4589
|
+
r37 = _nt_left_paren
|
4590
|
+
s36 << r37
|
4591
|
+
if r37
|
4592
|
+
r38 = _nt_space
|
4593
|
+
s36 << r38
|
4594
|
+
if r38
|
4595
|
+
if (match_len = has_terminal?("?", false, index))
|
4596
|
+
r39 = true
|
4597
|
+
@index += match_len
|
4598
|
+
else
|
4599
|
+
terminal_parse_failure('"?"')
|
4600
|
+
r39 = nil
|
4601
|
+
end
|
4602
|
+
s36 << r39
|
4603
|
+
if r39
|
4604
|
+
r40 = _nt_space
|
4605
|
+
s36 << r40
|
4606
|
+
if r40
|
4607
|
+
r41 = _nt_right_paren
|
4608
|
+
s36 << r41
|
4609
|
+
end
|
4610
|
+
end
|
4611
|
+
end
|
4612
|
+
end
|
4613
|
+
if s36.last
|
4614
|
+
r36 = instantiate_node(SyntaxNode,input, i36...index, s36)
|
4615
|
+
r36.extend(BasionymAuthorshipWithParenthesis8)
|
4616
|
+
r36.extend(BasionymAuthorshipWithParenthesis9)
|
4617
|
+
else
|
4618
|
+
@index = i36
|
4619
|
+
r36 = nil
|
4620
|
+
end
|
4621
|
+
if r36
|
4622
|
+
r36 = SyntaxNode.new(input, (index-1)...index) if r36 == true
|
4623
|
+
r0 = r36
|
4624
|
+
else
|
4625
|
+
@index = i0
|
4626
|
+
r0 = nil
|
4627
|
+
end
|
4501
4628
|
end
|
4502
4629
|
end
|
4503
4630
|
end
|
@@ -4666,6 +4793,71 @@ module ScientificNameClean
|
|
4666
4793
|
r0
|
4667
4794
|
end
|
4668
4795
|
|
4796
|
+
module EmendAuthorship0
|
4797
|
+
def emend
|
4798
|
+
elements[0]
|
4799
|
+
end
|
4800
|
+
|
4801
|
+
def space
|
4802
|
+
elements[1]
|
4803
|
+
end
|
4804
|
+
|
4805
|
+
def b
|
4806
|
+
elements[2]
|
4807
|
+
end
|
4808
|
+
end
|
4809
|
+
|
4810
|
+
module EmendAuthorship1
|
4811
|
+
def value
|
4812
|
+
" emend. " + b.value
|
4813
|
+
end
|
4814
|
+
|
4815
|
+
def pos
|
4816
|
+
b.pos
|
4817
|
+
end
|
4818
|
+
|
4819
|
+
def details
|
4820
|
+
val = {:emendAuthorTeam => {:authorTeam => b.text_value.strip}.merge(b.details[:basionymAuthorTeam])}
|
4821
|
+
val
|
4822
|
+
end
|
4823
|
+
end
|
4824
|
+
|
4825
|
+
def _nt_emend_authorship
|
4826
|
+
start_index = index
|
4827
|
+
if node_cache[:emend_authorship].has_key?(index)
|
4828
|
+
cached = node_cache[:emend_authorship][index]
|
4829
|
+
if cached
|
4830
|
+
node_cache[:emend_authorship][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4831
|
+
@index = cached.interval.end
|
4832
|
+
end
|
4833
|
+
return cached
|
4834
|
+
end
|
4835
|
+
|
4836
|
+
i0, s0 = index, []
|
4837
|
+
r1 = _nt_emend
|
4838
|
+
s0 << r1
|
4839
|
+
if r1
|
4840
|
+
r2 = _nt_space
|
4841
|
+
s0 << r2
|
4842
|
+
if r2
|
4843
|
+
r3 = _nt_simple_authorship
|
4844
|
+
s0 << r3
|
4845
|
+
end
|
4846
|
+
end
|
4847
|
+
if s0.last
|
4848
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
4849
|
+
r0.extend(EmendAuthorship0)
|
4850
|
+
r0.extend(EmendAuthorship1)
|
4851
|
+
else
|
4852
|
+
@index = i0
|
4853
|
+
r0 = nil
|
4854
|
+
end
|
4855
|
+
|
4856
|
+
node_cache[:emend_authorship][start_index] = r0
|
4857
|
+
|
4858
|
+
r0
|
4859
|
+
end
|
4860
|
+
|
4669
4861
|
module SimpleAuthorship0
|
4670
4862
|
def a
|
4671
4863
|
elements[0]
|
@@ -5298,6 +5490,80 @@ module ScientificNameClean
|
|
5298
5490
|
r0
|
5299
5491
|
end
|
5300
5492
|
|
5493
|
+
module Emend0
|
5494
|
+
end
|
5495
|
+
|
5496
|
+
def _nt_emend
|
5497
|
+
start_index = index
|
5498
|
+
if node_cache[:emend].has_key?(index)
|
5499
|
+
cached = node_cache[:emend][index]
|
5500
|
+
if cached
|
5501
|
+
node_cache[:emend][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5502
|
+
@index = cached.interval.end
|
5503
|
+
end
|
5504
|
+
return cached
|
5505
|
+
end
|
5506
|
+
|
5507
|
+
i0, s0 = index, []
|
5508
|
+
i1 = index
|
5509
|
+
if (match_len = has_terminal?("emend.", false, index))
|
5510
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5511
|
+
@index += match_len
|
5512
|
+
else
|
5513
|
+
terminal_parse_failure('"emend."')
|
5514
|
+
r2 = nil
|
5515
|
+
end
|
5516
|
+
if r2
|
5517
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5518
|
+
r1 = r2
|
5519
|
+
else
|
5520
|
+
if (match_len = has_terminal?("emend", false, index))
|
5521
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5522
|
+
@index += match_len
|
5523
|
+
else
|
5524
|
+
terminal_parse_failure('"emend"')
|
5525
|
+
r3 = nil
|
5526
|
+
end
|
5527
|
+
if r3
|
5528
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
5529
|
+
r1 = r3
|
5530
|
+
else
|
5531
|
+
@index = i1
|
5532
|
+
r1 = nil
|
5533
|
+
end
|
5534
|
+
end
|
5535
|
+
s0 << r1
|
5536
|
+
if r1
|
5537
|
+
i4 = index
|
5538
|
+
if has_terminal?(@regexps[gr = '\A[\\s]'] ||= Regexp.new(gr), :regexp, index)
|
5539
|
+
r5 = true
|
5540
|
+
@index += 1
|
5541
|
+
else
|
5542
|
+
terminal_parse_failure('[\\s]')
|
5543
|
+
r5 = nil
|
5544
|
+
end
|
5545
|
+
if r5
|
5546
|
+
@index = i4
|
5547
|
+
r4 = instantiate_node(SyntaxNode,input, index...index)
|
5548
|
+
else
|
5549
|
+
@index = i4
|
5550
|
+
r4 = nil
|
5551
|
+
end
|
5552
|
+
s0 << r4
|
5553
|
+
end
|
5554
|
+
if s0.last
|
5555
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
5556
|
+
r0.extend(Emend0)
|
5557
|
+
else
|
5558
|
+
@index = i0
|
5559
|
+
r0 = nil
|
5560
|
+
end
|
5561
|
+
|
5562
|
+
node_cache[:emend][start_index] = r0
|
5563
|
+
|
5564
|
+
r0
|
5565
|
+
end
|
5566
|
+
|
5301
5567
|
module AuthorSeparator0
|
5302
5568
|
def apply(a,b)
|
5303
5569
|
sep = text_value.strip
|
@@ -5456,6 +5722,38 @@ module ScientificNameClean
|
|
5456
5722
|
end
|
5457
5723
|
end
|
5458
5724
|
|
5725
|
+
module AuthorName2
|
5726
|
+
def space1
|
5727
|
+
elements[0]
|
5728
|
+
end
|
5729
|
+
|
5730
|
+
def a
|
5731
|
+
elements[1]
|
5732
|
+
end
|
5733
|
+
|
5734
|
+
def space2
|
5735
|
+
elements[2]
|
5736
|
+
end
|
5737
|
+
|
5738
|
+
def b
|
5739
|
+
elements[3]
|
5740
|
+
end
|
5741
|
+
end
|
5742
|
+
|
5743
|
+
module AuthorName3
|
5744
|
+
def value
|
5745
|
+
a.value + " " + b.value
|
5746
|
+
end
|
5747
|
+
|
5748
|
+
def pos
|
5749
|
+
a.pos.merge(b.pos)
|
5750
|
+
end
|
5751
|
+
|
5752
|
+
def details
|
5753
|
+
{:author => [value]}
|
5754
|
+
end
|
5755
|
+
end
|
5756
|
+
|
5459
5757
|
def _nt_author_name
|
5460
5758
|
start_index = index
|
5461
5759
|
if node_cache[:author_name].has_key?(index)
|
@@ -5478,7 +5776,7 @@ module ScientificNameClean
|
|
5478
5776
|
r4 = _nt_space
|
5479
5777
|
s1 << r4
|
5480
5778
|
if r4
|
5481
|
-
r5 =
|
5779
|
+
r5 = _nt_author_maybe_filius
|
5482
5780
|
s1 << r5
|
5483
5781
|
if r5
|
5484
5782
|
r6 = _nt_space
|
@@ -5511,13 +5809,41 @@ module ScientificNameClean
|
|
5511
5809
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5512
5810
|
r0 = r1
|
5513
5811
|
else
|
5514
|
-
|
5812
|
+
i9, s9 = index, []
|
5813
|
+
r10 = _nt_space
|
5814
|
+
s9 << r10
|
5815
|
+
if r10
|
5816
|
+
r11 = _nt_author_name_without_postfix
|
5817
|
+
s9 << r11
|
5818
|
+
if r11
|
5819
|
+
r12 = _nt_space
|
5820
|
+
s9 << r12
|
5821
|
+
if r12
|
5822
|
+
r13 = _nt_author_filius
|
5823
|
+
s9 << r13
|
5824
|
+
end
|
5825
|
+
end
|
5826
|
+
end
|
5827
|
+
if s9.last
|
5828
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
5829
|
+
r9.extend(AuthorName2)
|
5830
|
+
r9.extend(AuthorName3)
|
5831
|
+
else
|
5832
|
+
@index = i9
|
5833
|
+
r9 = nil
|
5834
|
+
end
|
5515
5835
|
if r9
|
5516
5836
|
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
5517
5837
|
r0 = r9
|
5518
5838
|
else
|
5519
|
-
|
5520
|
-
|
5839
|
+
r14 = _nt_author_name_without_postfix
|
5840
|
+
if r14
|
5841
|
+
r14 = SyntaxNode.new(input, (index-1)...index) if r14 == true
|
5842
|
+
r0 = r14
|
5843
|
+
else
|
5844
|
+
@index = i0
|
5845
|
+
r0 = nil
|
5846
|
+
end
|
5521
5847
|
end
|
5522
5848
|
end
|
5523
5849
|
|
@@ -5809,8 +6135,36 @@ module ScientificNameClean
|
|
5809
6135
|
r2.extend(AuthorWord1)
|
5810
6136
|
r2.extend(AuthorWord1)
|
5811
6137
|
else
|
5812
|
-
|
5813
|
-
|
6138
|
+
if (match_len = has_terminal?("& al.", false, index))
|
6139
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6140
|
+
@index += match_len
|
6141
|
+
else
|
6142
|
+
terminal_parse_failure('"& al."')
|
6143
|
+
r7 = nil
|
6144
|
+
end
|
6145
|
+
if r7
|
6146
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
6147
|
+
r2 = r7
|
6148
|
+
r2.extend(AuthorWord1)
|
6149
|
+
r2.extend(AuthorWord1)
|
6150
|
+
else
|
6151
|
+
if (match_len = has_terminal?("& al", false, index))
|
6152
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6153
|
+
@index += match_len
|
6154
|
+
else
|
6155
|
+
terminal_parse_failure('"& al"')
|
6156
|
+
r8 = nil
|
6157
|
+
end
|
6158
|
+
if r8
|
6159
|
+
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
6160
|
+
r2 = r8
|
6161
|
+
r2.extend(AuthorWord1)
|
6162
|
+
r2.extend(AuthorWord1)
|
6163
|
+
else
|
6164
|
+
@index = i2
|
6165
|
+
r2 = nil
|
6166
|
+
end
|
6167
|
+
end
|
5814
6168
|
end
|
5815
6169
|
end
|
5816
6170
|
end
|
@@ -5819,197 +6173,197 @@ module ScientificNameClean
|
|
5819
6173
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5820
6174
|
r0 = r2
|
5821
6175
|
else
|
5822
|
-
i7, s7 = index, []
|
5823
6176
|
i9, s9 = index, []
|
6177
|
+
i11, s11 = index, []
|
5824
6178
|
if (match_len = has_terminal?("d", false, index))
|
5825
|
-
|
6179
|
+
r12 = true
|
5826
6180
|
@index += match_len
|
5827
6181
|
else
|
5828
6182
|
terminal_parse_failure('"d"')
|
5829
|
-
|
6183
|
+
r12 = nil
|
5830
6184
|
end
|
5831
|
-
|
5832
|
-
if
|
6185
|
+
s11 << r12
|
6186
|
+
if r12
|
5833
6187
|
if has_terminal?(@regexps[gr = '\A[\'’]'] ||= Regexp.new(gr), :regexp, index)
|
5834
|
-
|
6188
|
+
r13 = true
|
5835
6189
|
@index += 1
|
5836
6190
|
else
|
5837
6191
|
terminal_parse_failure('[\'’]')
|
5838
|
-
|
6192
|
+
r13 = nil
|
5839
6193
|
end
|
5840
|
-
|
6194
|
+
s11 << r13
|
5841
6195
|
end
|
5842
|
-
if
|
5843
|
-
|
5844
|
-
|
6196
|
+
if s11.last
|
6197
|
+
r11 = instantiate_node(SyntaxNode,input, i11...index, s11)
|
6198
|
+
r11.extend(AuthorWord2)
|
5845
6199
|
else
|
5846
|
-
@index =
|
5847
|
-
|
6200
|
+
@index = i11
|
6201
|
+
r11 = nil
|
5848
6202
|
end
|
5849
|
-
if
|
5850
|
-
|
6203
|
+
if r11
|
6204
|
+
r10 = r11
|
5851
6205
|
else
|
5852
|
-
|
6206
|
+
r10 = instantiate_node(SyntaxNode,input, index...index)
|
5853
6207
|
end
|
5854
|
-
|
5855
|
-
if
|
5856
|
-
|
6208
|
+
s9 << r10
|
6209
|
+
if r10
|
6210
|
+
i14 = index
|
5857
6211
|
if (match_len = has_terminal?("Å", false, index))
|
5858
|
-
|
6212
|
+
r15 = true
|
5859
6213
|
@index += match_len
|
5860
6214
|
else
|
5861
6215
|
terminal_parse_failure('"Å"')
|
5862
|
-
|
6216
|
+
r15 = nil
|
5863
6217
|
end
|
5864
|
-
if
|
5865
|
-
|
5866
|
-
|
6218
|
+
if r15
|
6219
|
+
r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
|
6220
|
+
r14 = r15
|
5867
6221
|
else
|
5868
6222
|
if (match_len = has_terminal?("Ö", false, index))
|
5869
|
-
|
6223
|
+
r16 = true
|
5870
6224
|
@index += match_len
|
5871
6225
|
else
|
5872
6226
|
terminal_parse_failure('"Ö"')
|
5873
|
-
|
6227
|
+
r16 = nil
|
5874
6228
|
end
|
5875
|
-
if
|
5876
|
-
|
5877
|
-
|
6229
|
+
if r16
|
6230
|
+
r16 = SyntaxNode.new(input, (index-1)...index) if r16 == true
|
6231
|
+
r14 = r16
|
5878
6232
|
else
|
5879
6233
|
if (match_len = has_terminal?("Á", false, index))
|
5880
|
-
|
6234
|
+
r17 = true
|
5881
6235
|
@index += match_len
|
5882
6236
|
else
|
5883
6237
|
terminal_parse_failure('"Á"')
|
5884
|
-
|
6238
|
+
r17 = nil
|
5885
6239
|
end
|
5886
|
-
if
|
5887
|
-
|
5888
|
-
|
6240
|
+
if r17
|
6241
|
+
r17 = SyntaxNode.new(input, (index-1)...index) if r17 == true
|
6242
|
+
r14 = r17
|
5889
6243
|
else
|
5890
6244
|
if (match_len = has_terminal?("Ø", false, index))
|
5891
|
-
|
6245
|
+
r18 = true
|
5892
6246
|
@index += match_len
|
5893
6247
|
else
|
5894
6248
|
terminal_parse_failure('"Ø"')
|
5895
|
-
|
6249
|
+
r18 = nil
|
5896
6250
|
end
|
5897
|
-
if
|
5898
|
-
|
5899
|
-
|
6251
|
+
if r18
|
6252
|
+
r18 = SyntaxNode.new(input, (index-1)...index) if r18 == true
|
6253
|
+
r14 = r18
|
5900
6254
|
else
|
5901
6255
|
if (match_len = has_terminal?("Ô", false, index))
|
5902
|
-
|
6256
|
+
r19 = true
|
5903
6257
|
@index += match_len
|
5904
6258
|
else
|
5905
6259
|
terminal_parse_failure('"Ô"')
|
5906
|
-
|
6260
|
+
r19 = nil
|
5907
6261
|
end
|
5908
|
-
if
|
5909
|
-
|
5910
|
-
|
6262
|
+
if r19
|
6263
|
+
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
6264
|
+
r14 = r19
|
5911
6265
|
else
|
5912
6266
|
if (match_len = has_terminal?("Š", false, index))
|
5913
|
-
|
6267
|
+
r20 = true
|
5914
6268
|
@index += match_len
|
5915
6269
|
else
|
5916
6270
|
terminal_parse_failure('"Š"')
|
5917
|
-
|
6271
|
+
r20 = nil
|
5918
6272
|
end
|
5919
|
-
if
|
5920
|
-
|
5921
|
-
|
6273
|
+
if r20
|
6274
|
+
r20 = SyntaxNode.new(input, (index-1)...index) if r20 == true
|
6275
|
+
r14 = r20
|
5922
6276
|
else
|
5923
6277
|
if (match_len = has_terminal?("Ś", false, index))
|
5924
|
-
|
6278
|
+
r21 = true
|
5925
6279
|
@index += match_len
|
5926
6280
|
else
|
5927
6281
|
terminal_parse_failure('"Ś"')
|
5928
|
-
|
6282
|
+
r21 = nil
|
5929
6283
|
end
|
5930
|
-
if
|
5931
|
-
|
5932
|
-
|
6284
|
+
if r21
|
6285
|
+
r21 = SyntaxNode.new(input, (index-1)...index) if r21 == true
|
6286
|
+
r14 = r21
|
5933
6287
|
else
|
5934
6288
|
if (match_len = has_terminal?("Č", false, index))
|
5935
|
-
|
6289
|
+
r22 = true
|
5936
6290
|
@index += match_len
|
5937
6291
|
else
|
5938
6292
|
terminal_parse_failure('"Č"')
|
5939
|
-
|
6293
|
+
r22 = nil
|
5940
6294
|
end
|
5941
|
-
if
|
5942
|
-
|
5943
|
-
|
6295
|
+
if r22
|
6296
|
+
r22 = SyntaxNode.new(input, (index-1)...index) if r22 == true
|
6297
|
+
r14 = r22
|
5944
6298
|
else
|
5945
6299
|
if (match_len = has_terminal?("Ķ", false, index))
|
5946
|
-
|
6300
|
+
r23 = true
|
5947
6301
|
@index += match_len
|
5948
6302
|
else
|
5949
6303
|
terminal_parse_failure('"Ķ"')
|
5950
|
-
|
6304
|
+
r23 = nil
|
5951
6305
|
end
|
5952
|
-
if
|
5953
|
-
|
5954
|
-
|
6306
|
+
if r23
|
6307
|
+
r23 = SyntaxNode.new(input, (index-1)...index) if r23 == true
|
6308
|
+
r14 = r23
|
5955
6309
|
else
|
5956
6310
|
if (match_len = has_terminal?("Ł", false, index))
|
5957
|
-
|
6311
|
+
r24 = true
|
5958
6312
|
@index += match_len
|
5959
6313
|
else
|
5960
6314
|
terminal_parse_failure('"Ł"')
|
5961
|
-
|
6315
|
+
r24 = nil
|
5962
6316
|
end
|
5963
|
-
if
|
5964
|
-
|
5965
|
-
|
6317
|
+
if r24
|
6318
|
+
r24 = SyntaxNode.new(input, (index-1)...index) if r24 == true
|
6319
|
+
r14 = r24
|
5966
6320
|
else
|
5967
6321
|
if (match_len = has_terminal?("É", false, index))
|
5968
|
-
|
6322
|
+
r25 = true
|
5969
6323
|
@index += match_len
|
5970
6324
|
else
|
5971
6325
|
terminal_parse_failure('"É"')
|
5972
|
-
|
6326
|
+
r25 = nil
|
5973
6327
|
end
|
5974
|
-
if
|
5975
|
-
|
5976
|
-
|
6328
|
+
if r25
|
6329
|
+
r25 = SyntaxNode.new(input, (index-1)...index) if r25 == true
|
6330
|
+
r14 = r25
|
5977
6331
|
else
|
5978
6332
|
if (match_len = has_terminal?("Ž", false, index))
|
5979
|
-
|
6333
|
+
r26 = true
|
5980
6334
|
@index += match_len
|
5981
6335
|
else
|
5982
6336
|
terminal_parse_failure('"Ž"')
|
5983
|
-
|
6337
|
+
r26 = nil
|
5984
6338
|
end
|
5985
|
-
if
|
5986
|
-
|
5987
|
-
|
6339
|
+
if r26
|
6340
|
+
r26 = SyntaxNode.new(input, (index-1)...index) if r26 == true
|
6341
|
+
r14 = r26
|
5988
6342
|
else
|
5989
6343
|
if has_terminal?(@regexps[gr = '\A[A-W]'] ||= Regexp.new(gr), :regexp, index)
|
5990
|
-
|
6344
|
+
r27 = true
|
5991
6345
|
@index += 1
|
5992
6346
|
else
|
5993
6347
|
terminal_parse_failure('[A-W]')
|
5994
|
-
|
6348
|
+
r27 = nil
|
5995
6349
|
end
|
5996
|
-
if
|
5997
|
-
|
5998
|
-
|
6350
|
+
if r27
|
6351
|
+
r27 = SyntaxNode.new(input, (index-1)...index) if r27 == true
|
6352
|
+
r14 = r27
|
5999
6353
|
else
|
6000
6354
|
if has_terminal?(@regexps[gr = '\A[Y-Z]'] ||= Regexp.new(gr), :regexp, index)
|
6001
|
-
|
6355
|
+
r28 = true
|
6002
6356
|
@index += 1
|
6003
6357
|
else
|
6004
6358
|
terminal_parse_failure('[Y-Z]')
|
6005
|
-
|
6359
|
+
r28 = nil
|
6006
6360
|
end
|
6007
|
-
if
|
6008
|
-
|
6009
|
-
|
6361
|
+
if r28
|
6362
|
+
r28 = SyntaxNode.new(input, (index-1)...index) if r28 == true
|
6363
|
+
r14 = r28
|
6010
6364
|
else
|
6011
|
-
@index =
|
6012
|
-
|
6365
|
+
@index = i14
|
6366
|
+
r14 = nil
|
6013
6367
|
end
|
6014
6368
|
end
|
6015
6369
|
end
|
@@ -6024,88 +6378,88 @@ module ScientificNameClean
|
|
6024
6378
|
end
|
6025
6379
|
end
|
6026
6380
|
end
|
6027
|
-
|
6028
|
-
if
|
6029
|
-
|
6381
|
+
s9 << r14
|
6382
|
+
if r14
|
6383
|
+
s29, i29 = [], index
|
6030
6384
|
loop do
|
6031
6385
|
if has_terminal?(@regexps[gr = '\A[^0-9\\[\\]\\(\\)\\s&,]'] ||= Regexp.new(gr), :regexp, index)
|
6032
|
-
|
6386
|
+
r30 = true
|
6033
6387
|
@index += 1
|
6034
6388
|
else
|
6035
6389
|
terminal_parse_failure('[^0-9\\[\\]\\(\\)\\s&,]')
|
6036
|
-
|
6390
|
+
r30 = nil
|
6037
6391
|
end
|
6038
|
-
if
|
6039
|
-
|
6392
|
+
if r30
|
6393
|
+
s29 << r30
|
6040
6394
|
else
|
6041
6395
|
break
|
6042
6396
|
end
|
6043
6397
|
end
|
6044
|
-
|
6045
|
-
|
6398
|
+
r29 = instantiate_node(SyntaxNode,input, i29...index, s29)
|
6399
|
+
s9 << r29
|
6046
6400
|
end
|
6047
6401
|
end
|
6048
|
-
if
|
6049
|
-
|
6050
|
-
|
6051
|
-
|
6402
|
+
if s9.last
|
6403
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
6404
|
+
r9.extend(AuthorWord3)
|
6405
|
+
r9.extend(AuthorWord4)
|
6052
6406
|
else
|
6053
|
-
@index =
|
6054
|
-
|
6407
|
+
@index = i9
|
6408
|
+
r9 = nil
|
6055
6409
|
end
|
6056
|
-
if
|
6057
|
-
|
6058
|
-
r0 =
|
6410
|
+
if r9
|
6411
|
+
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
6412
|
+
r0 = r9
|
6059
6413
|
else
|
6060
|
-
|
6414
|
+
i31, s31 = index, []
|
6061
6415
|
if (match_len = has_terminal?("X", false, index))
|
6062
|
-
|
6416
|
+
r32 = true
|
6063
6417
|
@index += match_len
|
6064
6418
|
else
|
6065
6419
|
terminal_parse_failure('"X"')
|
6066
|
-
|
6420
|
+
r32 = nil
|
6067
6421
|
end
|
6068
|
-
|
6069
|
-
if
|
6070
|
-
|
6422
|
+
s31 << r32
|
6423
|
+
if r32
|
6424
|
+
s33, i33 = [], index
|
6071
6425
|
loop do
|
6072
6426
|
if has_terminal?(@regexps[gr = '\A[^0-9\\[\\]\\(\\)\\s&,]'] ||= Regexp.new(gr), :regexp, index)
|
6073
|
-
|
6427
|
+
r34 = true
|
6074
6428
|
@index += 1
|
6075
6429
|
else
|
6076
6430
|
terminal_parse_failure('[^0-9\\[\\]\\(\\)\\s&,]')
|
6077
|
-
|
6431
|
+
r34 = nil
|
6078
6432
|
end
|
6079
|
-
if
|
6080
|
-
|
6433
|
+
if r34
|
6434
|
+
s33 << r34
|
6081
6435
|
else
|
6082
6436
|
break
|
6083
6437
|
end
|
6084
6438
|
end
|
6085
|
-
if
|
6086
|
-
@index =
|
6087
|
-
|
6439
|
+
if s33.empty?
|
6440
|
+
@index = i33
|
6441
|
+
r33 = nil
|
6088
6442
|
else
|
6089
|
-
|
6443
|
+
r33 = instantiate_node(SyntaxNode,input, i33...index, s33)
|
6090
6444
|
end
|
6091
|
-
|
6445
|
+
s31 << r33
|
6092
6446
|
end
|
6093
|
-
if
|
6094
|
-
|
6095
|
-
|
6096
|
-
|
6447
|
+
if s31.last
|
6448
|
+
r31 = instantiate_node(SyntaxNode,input, i31...index, s31)
|
6449
|
+
r31.extend(AuthorWord5)
|
6450
|
+
r31.extend(AuthorWord6)
|
6097
6451
|
else
|
6098
|
-
@index =
|
6099
|
-
|
6452
|
+
@index = i31
|
6453
|
+
r31 = nil
|
6100
6454
|
end
|
6101
|
-
if
|
6102
|
-
|
6103
|
-
r0 =
|
6455
|
+
if r31
|
6456
|
+
r31 = SyntaxNode.new(input, (index-1)...index) if r31 == true
|
6457
|
+
r0 = r31
|
6104
6458
|
else
|
6105
|
-
|
6106
|
-
if
|
6107
|
-
|
6108
|
-
r0 =
|
6459
|
+
r35 = _nt_author_prefix_word
|
6460
|
+
if r35
|
6461
|
+
r35 = SyntaxNode.new(input, (index-1)...index) if r35 == true
|
6462
|
+
r0 = r35
|
6109
6463
|
else
|
6110
6464
|
@index = i0
|
6111
6465
|
r0 = nil
|
@@ -6319,41 +6673,53 @@ module ScientificNameClean
|
|
6319
6673
|
r17 = SyntaxNode.new(input, (index-1)...index) if r17 == true
|
6320
6674
|
r2 = r17
|
6321
6675
|
else
|
6322
|
-
if (match_len = has_terminal?("
|
6676
|
+
if (match_len = has_terminal?("'t", false, index))
|
6323
6677
|
r18 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6324
6678
|
@index += match_len
|
6325
6679
|
else
|
6326
|
-
terminal_parse_failure('"
|
6680
|
+
terminal_parse_failure('"\'t"')
|
6327
6681
|
r18 = nil
|
6328
6682
|
end
|
6329
6683
|
if r18
|
6330
6684
|
r18 = SyntaxNode.new(input, (index-1)...index) if r18 == true
|
6331
6685
|
r2 = r18
|
6332
6686
|
else
|
6333
|
-
if (match_len = has_terminal?("
|
6687
|
+
if (match_len = has_terminal?("ter", false, index))
|
6334
6688
|
r19 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6335
6689
|
@index += match_len
|
6336
6690
|
else
|
6337
|
-
terminal_parse_failure('"
|
6691
|
+
terminal_parse_failure('"ter"')
|
6338
6692
|
r19 = nil
|
6339
6693
|
end
|
6340
6694
|
if r19
|
6341
6695
|
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
6342
6696
|
r2 = r19
|
6343
6697
|
else
|
6344
|
-
if (match_len = has_terminal?("
|
6698
|
+
if (match_len = has_terminal?("van", false, index))
|
6345
6699
|
r20 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6346
6700
|
@index += match_len
|
6347
6701
|
else
|
6348
|
-
terminal_parse_failure('"
|
6702
|
+
terminal_parse_failure('"van"')
|
6349
6703
|
r20 = nil
|
6350
6704
|
end
|
6351
6705
|
if r20
|
6352
6706
|
r20 = SyntaxNode.new(input, (index-1)...index) if r20 == true
|
6353
6707
|
r2 = r20
|
6354
6708
|
else
|
6355
|
-
|
6356
|
-
|
6709
|
+
if (match_len = has_terminal?("von", false, index))
|
6710
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6711
|
+
@index += match_len
|
6712
|
+
else
|
6713
|
+
terminal_parse_failure('"von"')
|
6714
|
+
r21 = nil
|
6715
|
+
end
|
6716
|
+
if r21
|
6717
|
+
r21 = SyntaxNode.new(input, (index-1)...index) if r21 == true
|
6718
|
+
r2 = r21
|
6719
|
+
else
|
6720
|
+
@index = i2
|
6721
|
+
r2 = nil
|
6722
|
+
end
|
6357
6723
|
end
|
6358
6724
|
end
|
6359
6725
|
end
|
@@ -6374,16 +6740,16 @@ module ScientificNameClean
|
|
6374
6740
|
end
|
6375
6741
|
s0 << r2
|
6376
6742
|
if r2
|
6377
|
-
|
6378
|
-
|
6379
|
-
if
|
6380
|
-
@index =
|
6381
|
-
|
6743
|
+
i22 = index
|
6744
|
+
r23 = _nt_space_hard
|
6745
|
+
if r23
|
6746
|
+
@index = i22
|
6747
|
+
r22 = instantiate_node(SyntaxNode,input, index...index)
|
6382
6748
|
else
|
6383
|
-
@index =
|
6384
|
-
|
6749
|
+
@index = i22
|
6750
|
+
r22 = nil
|
6385
6751
|
end
|
6386
|
-
s0 <<
|
6752
|
+
s0 << r22
|
6387
6753
|
end
|
6388
6754
|
end
|
6389
6755
|
if s0.last
|
@@ -6400,7 +6766,7 @@ module ScientificNameClean
|
|
6400
6766
|
r0
|
6401
6767
|
end
|
6402
6768
|
|
6403
|
-
module
|
6769
|
+
module AuthorFilius0
|
6404
6770
|
def value
|
6405
6771
|
text_value.strip
|
6406
6772
|
end
|
@@ -6410,64 +6776,85 @@ module ScientificNameClean
|
|
6410
6776
|
end
|
6411
6777
|
end
|
6412
6778
|
|
6413
|
-
def
|
6779
|
+
def _nt_author_filius
|
6414
6780
|
start_index = index
|
6415
|
-
if node_cache[:
|
6416
|
-
cached = node_cache[:
|
6781
|
+
if node_cache[:author_filius].has_key?(index)
|
6782
|
+
cached = node_cache[:author_filius][index]
|
6417
6783
|
if cached
|
6418
|
-
node_cache[:
|
6784
|
+
node_cache[:author_filius][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
6419
6785
|
@index = cached.interval.end
|
6420
6786
|
end
|
6421
6787
|
return cached
|
6422
6788
|
end
|
6423
6789
|
|
6424
6790
|
i0 = index
|
6425
|
-
if (match_len = has_terminal?("
|
6791
|
+
if (match_len = has_terminal?("fil.", false, index))
|
6426
6792
|
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6427
6793
|
@index += match_len
|
6428
6794
|
else
|
6429
|
-
terminal_parse_failure('"
|
6795
|
+
terminal_parse_failure('"fil."')
|
6430
6796
|
r1 = nil
|
6431
6797
|
end
|
6432
6798
|
if r1
|
6433
6799
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
6434
6800
|
r0 = r1
|
6435
|
-
r0.extend(
|
6436
|
-
r0.extend(
|
6801
|
+
r0.extend(AuthorFilius0)
|
6802
|
+
r0.extend(AuthorFilius0)
|
6437
6803
|
else
|
6438
|
-
if (match_len = has_terminal?("
|
6804
|
+
if (match_len = has_terminal?("filius", false, index))
|
6439
6805
|
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6440
6806
|
@index += match_len
|
6441
6807
|
else
|
6442
|
-
terminal_parse_failure('"
|
6808
|
+
terminal_parse_failure('"filius"')
|
6443
6809
|
r2 = nil
|
6444
6810
|
end
|
6445
6811
|
if r2
|
6446
6812
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
6447
6813
|
r0 = r2
|
6448
|
-
r0.extend(
|
6449
|
-
r0.extend(
|
6814
|
+
r0.extend(AuthorFilius0)
|
6815
|
+
r0.extend(AuthorFilius0)
|
6450
6816
|
else
|
6451
|
-
|
6452
|
-
|
6453
|
-
@index += match_len
|
6454
|
-
else
|
6455
|
-
terminal_parse_failure('"filius"')
|
6456
|
-
r3 = nil
|
6457
|
-
end
|
6458
|
-
if r3
|
6459
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
6460
|
-
r0 = r3
|
6461
|
-
r0.extend(AuthorPostfixWord0)
|
6462
|
-
r0.extend(AuthorPostfixWord0)
|
6463
|
-
else
|
6464
|
-
@index = i0
|
6465
|
-
r0 = nil
|
6466
|
-
end
|
6817
|
+
@index = i0
|
6818
|
+
r0 = nil
|
6467
6819
|
end
|
6468
6820
|
end
|
6469
6821
|
|
6470
|
-
node_cache[:
|
6822
|
+
node_cache[:author_filius][start_index] = r0
|
6823
|
+
|
6824
|
+
r0
|
6825
|
+
end
|
6826
|
+
|
6827
|
+
module AuthorMaybeFilius0
|
6828
|
+
def value
|
6829
|
+
text_value.strip
|
6830
|
+
end
|
6831
|
+
|
6832
|
+
def pos
|
6833
|
+
{interval.begin => ["author_word", interval.end]}
|
6834
|
+
end
|
6835
|
+
end
|
6836
|
+
|
6837
|
+
def _nt_author_maybe_filius
|
6838
|
+
start_index = index
|
6839
|
+
if node_cache[:author_maybe_filius].has_key?(index)
|
6840
|
+
cached = node_cache[:author_maybe_filius][index]
|
6841
|
+
if cached
|
6842
|
+
node_cache[:author_maybe_filius][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
6843
|
+
@index = cached.interval.end
|
6844
|
+
end
|
6845
|
+
return cached
|
6846
|
+
end
|
6847
|
+
|
6848
|
+
if (match_len = has_terminal?("f.", false, index))
|
6849
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6850
|
+
r0.extend(AuthorMaybeFilius0)
|
6851
|
+
@index += match_len
|
6852
|
+
else
|
6853
|
+
terminal_parse_failure('"f."')
|
6854
|
+
r0 = nil
|
6855
|
+
end
|
6856
|
+
|
6857
|
+
node_cache[:author_maybe_filius][start_index] = r0
|
6471
6858
|
|
6472
6859
|
r0
|
6473
6860
|
end
|