dimus-biodiversity 0.0.16 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/biodiversity/parser/scientific_name_canonical.treetop +17 -0
- data/lib/biodiversity/parser/scientific_name_clean.rb +437 -323
- data/lib/biodiversity/parser/scientific_name_clean.treetop +47 -12
- data/spec/parser/scientific_name_canonical.spec.rb +6 -4
- data/spec/parser/scientific_name_clean.spec.rb +22 -1
- metadata +2 -2
@@ -8,6 +8,23 @@ grammar ScientificNameCanonical
|
|
8
8
|
end
|
9
9
|
|
10
10
|
rule name_part_with_garbage
|
11
|
+
a:species_name space b:latin_word space c:[^ш]+ {
|
12
|
+
def value
|
13
|
+
a.value + " " + b.value
|
14
|
+
end
|
15
|
+
def canonical
|
16
|
+
a.canonical + " " + b.value
|
17
|
+
end
|
18
|
+
|
19
|
+
def pos
|
20
|
+
a.pos.merge({b.interval.begin => ['subspecies', b.interval.end]})
|
21
|
+
end
|
22
|
+
|
23
|
+
def details
|
24
|
+
a.details.merge({:subspecies => {:rank => 'n/a', :value => b.value}}).merge(:name_part_verbatim => a.text_value, :auth_part_verbatim => c.text_value)
|
25
|
+
end
|
26
|
+
}
|
27
|
+
/
|
11
28
|
a:species_name space b:[^ш]+ {
|
12
29
|
def value
|
13
30
|
a.value
|
@@ -2339,125 +2339,35 @@ module ScientificNameClean
|
|
2339
2339
|
r2 = r6
|
2340
2340
|
r2.extend(AuthorWord1)
|
2341
2341
|
else
|
2342
|
-
|
2343
|
-
r7 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2344
|
-
@index += 2
|
2345
|
-
else
|
2346
|
-
terminal_parse_failure("da")
|
2347
|
-
r7 = nil
|
2348
|
-
end
|
2342
|
+
r7 = _nt_author_prefix
|
2349
2343
|
if r7
|
2350
2344
|
r2 = r7
|
2351
2345
|
r2.extend(AuthorWord1)
|
2352
2346
|
else
|
2353
|
-
if input.index("
|
2354
|
-
r8 = instantiate_node(SyntaxNode,input, index...(index +
|
2355
|
-
@index +=
|
2347
|
+
if input.index("et al.\{\?\}", index) == index
|
2348
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 9))
|
2349
|
+
@index += 9
|
2356
2350
|
else
|
2357
|
-
terminal_parse_failure("
|
2351
|
+
terminal_parse_failure("et al.\{\?\}")
|
2358
2352
|
r8 = nil
|
2359
2353
|
end
|
2360
2354
|
if r8
|
2361
2355
|
r2 = r8
|
2362
2356
|
r2.extend(AuthorWord1)
|
2363
2357
|
else
|
2364
|
-
if input.index("
|
2365
|
-
r9 = instantiate_node(SyntaxNode,input, index...(index +
|
2366
|
-
@index +=
|
2358
|
+
if input.index("et al.", index) == index
|
2359
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
2360
|
+
@index += 6
|
2367
2361
|
else
|
2368
|
-
terminal_parse_failure("
|
2362
|
+
terminal_parse_failure("et al.")
|
2369
2363
|
r9 = nil
|
2370
2364
|
end
|
2371
2365
|
if r9
|
2372
2366
|
r2 = r9
|
2373
2367
|
r2.extend(AuthorWord1)
|
2374
2368
|
else
|
2375
|
-
|
2376
|
-
|
2377
|
-
@index += 2
|
2378
|
-
else
|
2379
|
-
terminal_parse_failure("de")
|
2380
|
-
r10 = nil
|
2381
|
-
end
|
2382
|
-
if r10
|
2383
|
-
r2 = r10
|
2384
|
-
r2.extend(AuthorWord1)
|
2385
|
-
else
|
2386
|
-
if input.index("du", index) == index
|
2387
|
-
r11 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2388
|
-
@index += 2
|
2389
|
-
else
|
2390
|
-
terminal_parse_failure("du")
|
2391
|
-
r11 = nil
|
2392
|
-
end
|
2393
|
-
if r11
|
2394
|
-
r2 = r11
|
2395
|
-
r2.extend(AuthorWord1)
|
2396
|
-
else
|
2397
|
-
if input.index("la", index) == index
|
2398
|
-
r12 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2399
|
-
@index += 2
|
2400
|
-
else
|
2401
|
-
terminal_parse_failure("la")
|
2402
|
-
r12 = nil
|
2403
|
-
end
|
2404
|
-
if r12
|
2405
|
-
r2 = r12
|
2406
|
-
r2.extend(AuthorWord1)
|
2407
|
-
else
|
2408
|
-
if input.index("ter", index) == index
|
2409
|
-
r13 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
2410
|
-
@index += 3
|
2411
|
-
else
|
2412
|
-
terminal_parse_failure("ter")
|
2413
|
-
r13 = nil
|
2414
|
-
end
|
2415
|
-
if r13
|
2416
|
-
r2 = r13
|
2417
|
-
r2.extend(AuthorWord1)
|
2418
|
-
else
|
2419
|
-
if input.index("van", index) == index
|
2420
|
-
r14 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
2421
|
-
@index += 3
|
2422
|
-
else
|
2423
|
-
terminal_parse_failure("van")
|
2424
|
-
r14 = nil
|
2425
|
-
end
|
2426
|
-
if r14
|
2427
|
-
r2 = r14
|
2428
|
-
r2.extend(AuthorWord1)
|
2429
|
-
else
|
2430
|
-
if input.index("et al.\{\?\}", index) == index
|
2431
|
-
r15 = instantiate_node(SyntaxNode,input, index...(index + 9))
|
2432
|
-
@index += 9
|
2433
|
-
else
|
2434
|
-
terminal_parse_failure("et al.\{\?\}")
|
2435
|
-
r15 = nil
|
2436
|
-
end
|
2437
|
-
if r15
|
2438
|
-
r2 = r15
|
2439
|
-
r2.extend(AuthorWord1)
|
2440
|
-
else
|
2441
|
-
if input.index("et al.", index) == index
|
2442
|
-
r16 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
2443
|
-
@index += 6
|
2444
|
-
else
|
2445
|
-
terminal_parse_failure("et al.")
|
2446
|
-
r16 = nil
|
2447
|
-
end
|
2448
|
-
if r16
|
2449
|
-
r2 = r16
|
2450
|
-
r2.extend(AuthorWord1)
|
2451
|
-
else
|
2452
|
-
self.index = i2
|
2453
|
-
r2 = nil
|
2454
|
-
end
|
2455
|
-
end
|
2456
|
-
end
|
2457
|
-
end
|
2458
|
-
end
|
2459
|
-
end
|
2460
|
-
end
|
2369
|
+
self.index = i2
|
2370
|
+
r2 = nil
|
2461
2371
|
end
|
2462
2372
|
end
|
2463
2373
|
end
|
@@ -2468,139 +2378,139 @@ module ScientificNameClean
|
|
2468
2378
|
if r2
|
2469
2379
|
r0 = r2
|
2470
2380
|
else
|
2471
|
-
|
2472
|
-
|
2381
|
+
i10, s10 = index, []
|
2382
|
+
i11 = index
|
2473
2383
|
if input.index("Å", index) == index
|
2474
|
-
|
2384
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2475
2385
|
@index += 1
|
2476
2386
|
else
|
2477
2387
|
terminal_parse_failure("Å")
|
2478
|
-
|
2388
|
+
r12 = nil
|
2479
2389
|
end
|
2480
|
-
if
|
2481
|
-
|
2390
|
+
if r12
|
2391
|
+
r11 = r12
|
2482
2392
|
else
|
2483
2393
|
if input.index("Ö", index) == index
|
2484
|
-
|
2394
|
+
r13 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2485
2395
|
@index += 1
|
2486
2396
|
else
|
2487
2397
|
terminal_parse_failure("Ö")
|
2488
|
-
|
2398
|
+
r13 = nil
|
2489
2399
|
end
|
2490
|
-
if
|
2491
|
-
|
2400
|
+
if r13
|
2401
|
+
r11 = r13
|
2492
2402
|
else
|
2493
2403
|
if input.index("Á", index) == index
|
2494
|
-
|
2404
|
+
r14 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2495
2405
|
@index += 1
|
2496
2406
|
else
|
2497
2407
|
terminal_parse_failure("Á")
|
2498
|
-
|
2408
|
+
r14 = nil
|
2499
2409
|
end
|
2500
|
-
if
|
2501
|
-
|
2410
|
+
if r14
|
2411
|
+
r11 = r14
|
2502
2412
|
else
|
2503
2413
|
if input.index("Ø", index) == index
|
2504
|
-
|
2414
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2505
2415
|
@index += 1
|
2506
2416
|
else
|
2507
2417
|
terminal_parse_failure("Ø")
|
2508
|
-
|
2418
|
+
r15 = nil
|
2509
2419
|
end
|
2510
|
-
if
|
2511
|
-
|
2420
|
+
if r15
|
2421
|
+
r11 = r15
|
2512
2422
|
else
|
2513
2423
|
if input.index("Ô", index) == index
|
2514
|
-
|
2424
|
+
r16 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2515
2425
|
@index += 1
|
2516
2426
|
else
|
2517
2427
|
terminal_parse_failure("Ô")
|
2518
|
-
|
2428
|
+
r16 = nil
|
2519
2429
|
end
|
2520
|
-
if
|
2521
|
-
|
2430
|
+
if r16
|
2431
|
+
r11 = r16
|
2522
2432
|
else
|
2523
2433
|
if input.index("Š", index) == index
|
2524
|
-
|
2434
|
+
r17 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2525
2435
|
@index += 1
|
2526
2436
|
else
|
2527
2437
|
terminal_parse_failure("Š")
|
2528
|
-
|
2438
|
+
r17 = nil
|
2529
2439
|
end
|
2530
|
-
if
|
2531
|
-
|
2440
|
+
if r17
|
2441
|
+
r11 = r17
|
2532
2442
|
else
|
2533
2443
|
if input.index("Ś", index) == index
|
2534
|
-
|
2444
|
+
r18 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2535
2445
|
@index += 1
|
2536
2446
|
else
|
2537
2447
|
terminal_parse_failure("Ś")
|
2538
|
-
|
2448
|
+
r18 = nil
|
2539
2449
|
end
|
2540
|
-
if
|
2541
|
-
|
2450
|
+
if r18
|
2451
|
+
r11 = r18
|
2542
2452
|
else
|
2543
2453
|
if input.index("Č", index) == index
|
2544
|
-
|
2454
|
+
r19 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2545
2455
|
@index += 1
|
2546
2456
|
else
|
2547
2457
|
terminal_parse_failure("Č")
|
2548
|
-
|
2458
|
+
r19 = nil
|
2549
2459
|
end
|
2550
|
-
if
|
2551
|
-
|
2460
|
+
if r19
|
2461
|
+
r11 = r19
|
2552
2462
|
else
|
2553
2463
|
if input.index("Ķ", index) == index
|
2554
|
-
|
2464
|
+
r20 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2555
2465
|
@index += 1
|
2556
2466
|
else
|
2557
2467
|
terminal_parse_failure("Ķ")
|
2558
|
-
|
2468
|
+
r20 = nil
|
2559
2469
|
end
|
2560
|
-
if
|
2561
|
-
|
2470
|
+
if r20
|
2471
|
+
r11 = r20
|
2562
2472
|
else
|
2563
2473
|
if input.index("Ł", index) == index
|
2564
|
-
|
2474
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2565
2475
|
@index += 1
|
2566
2476
|
else
|
2567
2477
|
terminal_parse_failure("Ł")
|
2568
|
-
|
2478
|
+
r21 = nil
|
2569
2479
|
end
|
2570
|
-
if
|
2571
|
-
|
2480
|
+
if r21
|
2481
|
+
r11 = r21
|
2572
2482
|
else
|
2573
2483
|
if input.index("É", index) == index
|
2574
|
-
|
2484
|
+
r22 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2575
2485
|
@index += 1
|
2576
2486
|
else
|
2577
2487
|
terminal_parse_failure("É")
|
2578
|
-
|
2488
|
+
r22 = nil
|
2579
2489
|
end
|
2580
|
-
if
|
2581
|
-
|
2490
|
+
if r22
|
2491
|
+
r11 = r22
|
2582
2492
|
else
|
2583
2493
|
if input.index("Ž", index) == index
|
2584
|
-
|
2494
|
+
r23 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2585
2495
|
@index += 1
|
2586
2496
|
else
|
2587
2497
|
terminal_parse_failure("Ž")
|
2588
|
-
|
2498
|
+
r23 = nil
|
2589
2499
|
end
|
2590
|
-
if
|
2591
|
-
|
2500
|
+
if r23
|
2501
|
+
r11 = r23
|
2592
2502
|
else
|
2593
2503
|
if input.index(Regexp.new('[A-Z]'), index) == index
|
2594
|
-
|
2504
|
+
r24 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2595
2505
|
@index += 1
|
2596
2506
|
else
|
2597
|
-
|
2507
|
+
r24 = nil
|
2598
2508
|
end
|
2599
|
-
if
|
2600
|
-
|
2509
|
+
if r24
|
2510
|
+
r11 = r24
|
2601
2511
|
else
|
2602
|
-
self.index =
|
2603
|
-
|
2512
|
+
self.index = i11
|
2513
|
+
r11 = nil
|
2604
2514
|
end
|
2605
2515
|
end
|
2606
2516
|
end
|
@@ -2614,40 +2524,40 @@ module ScientificNameClean
|
|
2614
2524
|
end
|
2615
2525
|
end
|
2616
2526
|
end
|
2617
|
-
|
2618
|
-
if
|
2619
|
-
|
2527
|
+
s10 << r11
|
2528
|
+
if r11
|
2529
|
+
s25, i25 = [], index
|
2620
2530
|
loop do
|
2621
2531
|
if input.index(Regexp.new('[^0-9()\\s&,]'), index) == index
|
2622
|
-
|
2532
|
+
r26 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2623
2533
|
@index += 1
|
2624
2534
|
else
|
2625
|
-
|
2535
|
+
r26 = nil
|
2626
2536
|
end
|
2627
|
-
if
|
2628
|
-
|
2537
|
+
if r26
|
2538
|
+
s25 << r26
|
2629
2539
|
else
|
2630
2540
|
break
|
2631
2541
|
end
|
2632
2542
|
end
|
2633
|
-
if
|
2634
|
-
self.index =
|
2635
|
-
|
2543
|
+
if s25.empty?
|
2544
|
+
self.index = i25
|
2545
|
+
r25 = nil
|
2636
2546
|
else
|
2637
|
-
|
2547
|
+
r25 = instantiate_node(SyntaxNode,input, i25...index, s25)
|
2638
2548
|
end
|
2639
|
-
|
2549
|
+
s10 << r25
|
2640
2550
|
end
|
2641
|
-
if
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2551
|
+
if s10.last
|
2552
|
+
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
|
2553
|
+
r10.extend(AuthorWord2)
|
2554
|
+
r10.extend(AuthorWord3)
|
2645
2555
|
else
|
2646
|
-
self.index =
|
2647
|
-
|
2556
|
+
self.index = i10
|
2557
|
+
r10 = nil
|
2648
2558
|
end
|
2649
|
-
if
|
2650
|
-
r0 =
|
2559
|
+
if r10
|
2560
|
+
r0 = r10
|
2651
2561
|
else
|
2652
2562
|
self.index = i0
|
2653
2563
|
r0 = nil
|
@@ -2660,6 +2570,111 @@ module ScientificNameClean
|
|
2660
2570
|
return r0
|
2661
2571
|
end
|
2662
2572
|
|
2573
|
+
def _nt_author_prefix
|
2574
|
+
start_index = index
|
2575
|
+
if node_cache[:author_prefix].has_key?(index)
|
2576
|
+
cached = node_cache[:author_prefix][index]
|
2577
|
+
@index = cached.interval.end if cached
|
2578
|
+
return cached
|
2579
|
+
end
|
2580
|
+
|
2581
|
+
i0 = index
|
2582
|
+
if input.index("da", index) == index
|
2583
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2584
|
+
@index += 2
|
2585
|
+
else
|
2586
|
+
terminal_parse_failure("da")
|
2587
|
+
r1 = nil
|
2588
|
+
end
|
2589
|
+
if r1
|
2590
|
+
r0 = r1
|
2591
|
+
else
|
2592
|
+
if input.index("der", index) == index
|
2593
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
2594
|
+
@index += 3
|
2595
|
+
else
|
2596
|
+
terminal_parse_failure("der")
|
2597
|
+
r2 = nil
|
2598
|
+
end
|
2599
|
+
if r2
|
2600
|
+
r0 = r2
|
2601
|
+
else
|
2602
|
+
if input.index("den", index) == index
|
2603
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
2604
|
+
@index += 3
|
2605
|
+
else
|
2606
|
+
terminal_parse_failure("den")
|
2607
|
+
r3 = nil
|
2608
|
+
end
|
2609
|
+
if r3
|
2610
|
+
r0 = r3
|
2611
|
+
else
|
2612
|
+
if input.index("de", index) == index
|
2613
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2614
|
+
@index += 2
|
2615
|
+
else
|
2616
|
+
terminal_parse_failure("de")
|
2617
|
+
r4 = nil
|
2618
|
+
end
|
2619
|
+
if r4
|
2620
|
+
r0 = r4
|
2621
|
+
else
|
2622
|
+
if input.index("du", index) == index
|
2623
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2624
|
+
@index += 2
|
2625
|
+
else
|
2626
|
+
terminal_parse_failure("du")
|
2627
|
+
r5 = nil
|
2628
|
+
end
|
2629
|
+
if r5
|
2630
|
+
r0 = r5
|
2631
|
+
else
|
2632
|
+
if input.index("la", index) == index
|
2633
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2634
|
+
@index += 2
|
2635
|
+
else
|
2636
|
+
terminal_parse_failure("la")
|
2637
|
+
r6 = nil
|
2638
|
+
end
|
2639
|
+
if r6
|
2640
|
+
r0 = r6
|
2641
|
+
else
|
2642
|
+
if input.index("ter", index) == index
|
2643
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
2644
|
+
@index += 3
|
2645
|
+
else
|
2646
|
+
terminal_parse_failure("ter")
|
2647
|
+
r7 = nil
|
2648
|
+
end
|
2649
|
+
if r7
|
2650
|
+
r0 = r7
|
2651
|
+
else
|
2652
|
+
if input.index("van", index) == index
|
2653
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
2654
|
+
@index += 3
|
2655
|
+
else
|
2656
|
+
terminal_parse_failure("van")
|
2657
|
+
r8 = nil
|
2658
|
+
end
|
2659
|
+
if r8
|
2660
|
+
r0 = r8
|
2661
|
+
else
|
2662
|
+
self.index = i0
|
2663
|
+
r0 = nil
|
2664
|
+
end
|
2665
|
+
end
|
2666
|
+
end
|
2667
|
+
end
|
2668
|
+
end
|
2669
|
+
end
|
2670
|
+
end
|
2671
|
+
end
|
2672
|
+
|
2673
|
+
node_cache[:author_prefix][start_index] = r0
|
2674
|
+
|
2675
|
+
return r0
|
2676
|
+
end
|
2677
|
+
|
2663
2678
|
module NamePart0
|
2664
2679
|
def space
|
2665
2680
|
elements[0]
|
@@ -2708,6 +2723,45 @@ module ScientificNameClean
|
|
2708
2723
|
elements[0]
|
2709
2724
|
end
|
2710
2725
|
|
2726
|
+
def author_prefix
|
2727
|
+
elements[1]
|
2728
|
+
end
|
2729
|
+
end
|
2730
|
+
|
2731
|
+
module NamePart3
|
2732
|
+
def space
|
2733
|
+
elements[0]
|
2734
|
+
end
|
2735
|
+
|
2736
|
+
def a
|
2737
|
+
elements[1]
|
2738
|
+
end
|
2739
|
+
|
2740
|
+
end
|
2741
|
+
|
2742
|
+
module NamePart4
|
2743
|
+
def value
|
2744
|
+
a.value
|
2745
|
+
end
|
2746
|
+
|
2747
|
+
def canonical
|
2748
|
+
a.canonical
|
2749
|
+
end
|
2750
|
+
|
2751
|
+
def pos
|
2752
|
+
a.pos
|
2753
|
+
end
|
2754
|
+
|
2755
|
+
def details
|
2756
|
+
a.details
|
2757
|
+
end
|
2758
|
+
end
|
2759
|
+
|
2760
|
+
module NamePart5
|
2761
|
+
def space
|
2762
|
+
elements[0]
|
2763
|
+
end
|
2764
|
+
|
2711
2765
|
def a
|
2712
2766
|
elements[1]
|
2713
2767
|
end
|
@@ -2721,7 +2775,7 @@ module ScientificNameClean
|
|
2721
2775
|
end
|
2722
2776
|
end
|
2723
2777
|
|
2724
|
-
module
|
2778
|
+
module NamePart6
|
2725
2779
|
def value
|
2726
2780
|
a.value + b.value
|
2727
2781
|
end
|
@@ -2738,7 +2792,7 @@ module ScientificNameClean
|
|
2738
2792
|
end
|
2739
2793
|
end
|
2740
2794
|
|
2741
|
-
module
|
2795
|
+
module NamePart7
|
2742
2796
|
def space
|
2743
2797
|
elements[0]
|
2744
2798
|
end
|
@@ -2757,13 +2811,13 @@ module ScientificNameClean
|
|
2757
2811
|
|
2758
2812
|
end
|
2759
2813
|
|
2760
|
-
module
|
2814
|
+
module NamePart8
|
2761
2815
|
def value
|
2762
2816
|
a.value + " " + b.value
|
2763
2817
|
end
|
2764
2818
|
|
2765
2819
|
def canonical
|
2766
|
-
value
|
2820
|
+
a.canonical + " " + b.value
|
2767
2821
|
end
|
2768
2822
|
|
2769
2823
|
def pos
|
@@ -2825,18 +2879,34 @@ module ScientificNameClean
|
|
2825
2879
|
r10 = _nt_species_name
|
2826
2880
|
s8 << r10
|
2827
2881
|
if r10
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
2832
|
-
|
2882
|
+
i11 = index
|
2883
|
+
i12, s12 = index, []
|
2884
|
+
r13 = _nt_space
|
2885
|
+
s12 << r13
|
2886
|
+
if r13
|
2887
|
+
r14 = _nt_author_prefix
|
2888
|
+
s12 << r14
|
2889
|
+
end
|
2890
|
+
if s12.last
|
2891
|
+
r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
|
2892
|
+
r12.extend(NamePart2)
|
2893
|
+
else
|
2894
|
+
self.index = i12
|
2895
|
+
r12 = nil
|
2896
|
+
end
|
2897
|
+
if r12
|
2898
|
+
self.index = i11
|
2899
|
+
r11 = instantiate_node(SyntaxNode,input, index...index)
|
2900
|
+
else
|
2901
|
+
r11 = nil
|
2833
2902
|
end
|
2903
|
+
s8 << r11
|
2834
2904
|
end
|
2835
2905
|
end
|
2836
2906
|
if s8.last
|
2837
2907
|
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
2838
|
-
r8.extend(NamePart2)
|
2839
2908
|
r8.extend(NamePart3)
|
2909
|
+
r8.extend(NamePart4)
|
2840
2910
|
else
|
2841
2911
|
self.index = i8
|
2842
2912
|
r8 = nil
|
@@ -2844,58 +2914,85 @@ module ScientificNameClean
|
|
2844
2914
|
if r8
|
2845
2915
|
r0 = r8
|
2846
2916
|
else
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
if
|
2851
|
-
|
2852
|
-
|
2853
|
-
if
|
2854
|
-
|
2855
|
-
|
2856
|
-
if
|
2857
|
-
|
2858
|
-
|
2859
|
-
if r17
|
2860
|
-
i18 = index
|
2861
|
-
if input.index(Regexp.new('[\\.]'), index) == index
|
2862
|
-
r19 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2863
|
-
@index += 1
|
2864
|
-
else
|
2865
|
-
r19 = nil
|
2866
|
-
end
|
2867
|
-
if r19
|
2868
|
-
r18 = nil
|
2869
|
-
else
|
2870
|
-
self.index = i18
|
2871
|
-
r18 = instantiate_node(SyntaxNode,input, index...index)
|
2872
|
-
end
|
2873
|
-
s13 << r18
|
2874
|
-
end
|
2917
|
+
i15, s15 = index, []
|
2918
|
+
r16 = _nt_space
|
2919
|
+
s15 << r16
|
2920
|
+
if r16
|
2921
|
+
r17 = _nt_species_name
|
2922
|
+
s15 << r17
|
2923
|
+
if r17
|
2924
|
+
r18 = _nt_space
|
2925
|
+
s15 << r18
|
2926
|
+
if r18
|
2927
|
+
r19 = _nt_subspecies_names
|
2928
|
+
s15 << r19
|
2875
2929
|
end
|
2876
2930
|
end
|
2877
2931
|
end
|
2878
|
-
if
|
2879
|
-
|
2880
|
-
|
2881
|
-
|
2932
|
+
if s15.last
|
2933
|
+
r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
|
2934
|
+
r15.extend(NamePart5)
|
2935
|
+
r15.extend(NamePart6)
|
2882
2936
|
else
|
2883
|
-
self.index =
|
2884
|
-
|
2937
|
+
self.index = i15
|
2938
|
+
r15 = nil
|
2885
2939
|
end
|
2886
|
-
if
|
2887
|
-
r0 =
|
2940
|
+
if r15
|
2941
|
+
r0 = r15
|
2888
2942
|
else
|
2889
|
-
|
2943
|
+
i20, s20 = index, []
|
2944
|
+
r21 = _nt_space
|
2945
|
+
s20 << r21
|
2946
|
+
if r21
|
2947
|
+
r22 = _nt_species_name
|
2948
|
+
s20 << r22
|
2949
|
+
if r22
|
2950
|
+
r23 = _nt_space
|
2951
|
+
s20 << r23
|
2952
|
+
if r23
|
2953
|
+
r24 = _nt_latin_word
|
2954
|
+
s20 << r24
|
2955
|
+
if r24
|
2956
|
+
i25 = index
|
2957
|
+
if input.index(Regexp.new('[\\.]'), index) == index
|
2958
|
+
r26 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2959
|
+
@index += 1
|
2960
|
+
else
|
2961
|
+
r26 = nil
|
2962
|
+
end
|
2963
|
+
if r26
|
2964
|
+
r25 = nil
|
2965
|
+
else
|
2966
|
+
self.index = i25
|
2967
|
+
r25 = instantiate_node(SyntaxNode,input, index...index)
|
2968
|
+
end
|
2969
|
+
s20 << r25
|
2970
|
+
end
|
2971
|
+
end
|
2972
|
+
end
|
2973
|
+
end
|
2974
|
+
if s20.last
|
2975
|
+
r20 = instantiate_node(SyntaxNode,input, i20...index, s20)
|
2976
|
+
r20.extend(NamePart7)
|
2977
|
+
r20.extend(NamePart8)
|
2978
|
+
else
|
2979
|
+
self.index = i20
|
2980
|
+
r20 = nil
|
2981
|
+
end
|
2890
2982
|
if r20
|
2891
2983
|
r0 = r20
|
2892
2984
|
else
|
2893
|
-
|
2894
|
-
if
|
2895
|
-
r0 =
|
2985
|
+
r27 = _nt_species_name
|
2986
|
+
if r27
|
2987
|
+
r0 = r27
|
2896
2988
|
else
|
2897
|
-
|
2898
|
-
|
2989
|
+
r28 = _nt_cap_latin_word
|
2990
|
+
if r28
|
2991
|
+
r0 = r28
|
2992
|
+
else
|
2993
|
+
self.index = i0
|
2994
|
+
r0 = nil
|
2995
|
+
end
|
2899
2996
|
end
|
2900
2997
|
end
|
2901
2998
|
end
|
@@ -3295,327 +3392,339 @@ module ScientificNameClean
|
|
3295
3392
|
r1 = r5
|
3296
3393
|
r1.extend(Rank0)
|
3297
3394
|
else
|
3298
|
-
if input.index("
|
3299
|
-
r6 = instantiate_node(SyntaxNode,input, index...(index +
|
3300
|
-
@index +=
|
3395
|
+
if input.index("nat", index) == index
|
3396
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
3397
|
+
@index += 3
|
3301
3398
|
else
|
3302
|
-
terminal_parse_failure("
|
3399
|
+
terminal_parse_failure("nat")
|
3303
3400
|
r6 = nil
|
3304
3401
|
end
|
3305
3402
|
if r6
|
3306
3403
|
r1 = r6
|
3307
3404
|
r1.extend(Rank0)
|
3308
3405
|
else
|
3309
|
-
if input.index("
|
3310
|
-
r7 = instantiate_node(SyntaxNode,input, index...(index +
|
3311
|
-
@index +=
|
3406
|
+
if input.index("mut.", index) == index
|
3407
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
3408
|
+
@index += 4
|
3312
3409
|
else
|
3313
|
-
terminal_parse_failure("
|
3410
|
+
terminal_parse_failure("mut.")
|
3314
3411
|
r7 = nil
|
3315
3412
|
end
|
3316
3413
|
if r7
|
3317
3414
|
r1 = r7
|
3318
3415
|
r1.extend(Rank0)
|
3319
3416
|
else
|
3320
|
-
if input.index("
|
3321
|
-
r8 = instantiate_node(SyntaxNode,input, index...(index +
|
3322
|
-
@index +=
|
3417
|
+
if input.index("pseudovar.", index) == index
|
3418
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 10))
|
3419
|
+
@index += 10
|
3323
3420
|
else
|
3324
|
-
terminal_parse_failure("
|
3421
|
+
terminal_parse_failure("pseudovar.")
|
3325
3422
|
r8 = nil
|
3326
3423
|
end
|
3327
3424
|
if r8
|
3328
3425
|
r1 = r8
|
3329
3426
|
r1.extend(Rank0)
|
3330
3427
|
else
|
3331
|
-
if input.index("
|
3332
|
-
r9 = instantiate_node(SyntaxNode,input, index...(index +
|
3333
|
-
@index +=
|
3428
|
+
if input.index("sect.", index) == index
|
3429
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 5))
|
3430
|
+
@index += 5
|
3334
3431
|
else
|
3335
|
-
terminal_parse_failure("
|
3432
|
+
terminal_parse_failure("sect.")
|
3336
3433
|
r9 = nil
|
3337
3434
|
end
|
3338
3435
|
if r9
|
3339
3436
|
r1 = r9
|
3340
3437
|
r1.extend(Rank0)
|
3341
3438
|
else
|
3342
|
-
if input.index("
|
3439
|
+
if input.index("ser.", index) == index
|
3343
3440
|
r10 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
3344
3441
|
@index += 4
|
3345
3442
|
else
|
3346
|
-
terminal_parse_failure("
|
3443
|
+
terminal_parse_failure("ser.")
|
3347
3444
|
r10 = nil
|
3348
3445
|
end
|
3349
3446
|
if r10
|
3350
3447
|
r1 = r10
|
3351
3448
|
r1.extend(Rank0)
|
3352
3449
|
else
|
3353
|
-
if input.index("
|
3354
|
-
r11 = instantiate_node(SyntaxNode,input, index...(index +
|
3355
|
-
@index +=
|
3450
|
+
if input.index("var.", index) == index
|
3451
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
3452
|
+
@index += 4
|
3356
3453
|
else
|
3357
|
-
terminal_parse_failure("
|
3454
|
+
terminal_parse_failure("var.")
|
3358
3455
|
r11 = nil
|
3359
3456
|
end
|
3360
3457
|
if r11
|
3361
3458
|
r1 = r11
|
3362
3459
|
r1.extend(Rank0)
|
3363
3460
|
else
|
3364
|
-
if input.index("
|
3365
|
-
r12 = instantiate_node(SyntaxNode,input, index...(index +
|
3366
|
-
@index +=
|
3461
|
+
if input.index("subvar.", index) == index
|
3462
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + 7))
|
3463
|
+
@index += 7
|
3367
3464
|
else
|
3368
|
-
terminal_parse_failure("
|
3465
|
+
terminal_parse_failure("subvar.")
|
3369
3466
|
r12 = nil
|
3370
3467
|
end
|
3371
3468
|
if r12
|
3372
3469
|
r1 = r12
|
3373
3470
|
r1.extend(Rank0)
|
3374
3471
|
else
|
3375
|
-
if input.index("
|
3472
|
+
if input.index("[var.]", index) == index
|
3376
3473
|
r13 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
3377
3474
|
@index += 6
|
3378
3475
|
else
|
3379
|
-
terminal_parse_failure("
|
3476
|
+
terminal_parse_failure("[var.]")
|
3380
3477
|
r13 = nil
|
3381
3478
|
end
|
3382
3479
|
if r13
|
3383
3480
|
r1 = r13
|
3384
3481
|
r1.extend(Rank0)
|
3385
3482
|
else
|
3386
|
-
if input.index("
|
3387
|
-
r14 = instantiate_node(SyntaxNode,input, index...(index +
|
3388
|
-
@index +=
|
3483
|
+
if input.index("subsp.", index) == index
|
3484
|
+
r14 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
3485
|
+
@index += 6
|
3389
3486
|
else
|
3390
|
-
terminal_parse_failure("
|
3487
|
+
terminal_parse_failure("subsp.")
|
3391
3488
|
r14 = nil
|
3392
3489
|
end
|
3393
3490
|
if r14
|
3394
3491
|
r1 = r14
|
3395
3492
|
r1.extend(Rank0)
|
3396
3493
|
else
|
3397
|
-
if input.index("
|
3398
|
-
r15 = instantiate_node(SyntaxNode,input, index...(index +
|
3399
|
-
@index +=
|
3494
|
+
if input.index("subf.", index) == index
|
3495
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 5))
|
3496
|
+
@index += 5
|
3400
3497
|
else
|
3401
|
-
terminal_parse_failure("
|
3498
|
+
terminal_parse_failure("subf.")
|
3402
3499
|
r15 = nil
|
3403
3500
|
end
|
3404
3501
|
if r15
|
3405
3502
|
r1 = r15
|
3406
3503
|
r1.extend(Rank0)
|
3407
3504
|
else
|
3408
|
-
if input.index("
|
3409
|
-
r16 = instantiate_node(SyntaxNode,input, index...(index +
|
3410
|
-
@index +=
|
3505
|
+
if input.index("race", index) == index
|
3506
|
+
r16 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
3507
|
+
@index += 4
|
3411
3508
|
else
|
3412
|
-
terminal_parse_failure("
|
3509
|
+
terminal_parse_failure("race")
|
3413
3510
|
r16 = nil
|
3414
3511
|
end
|
3415
3512
|
if r16
|
3416
3513
|
r1 = r16
|
3417
3514
|
r1.extend(Rank0)
|
3418
3515
|
else
|
3419
|
-
if input.index("
|
3420
|
-
r17 = instantiate_node(SyntaxNode,input, index...(index +
|
3421
|
-
@index +=
|
3516
|
+
if input.index("α", index) == index
|
3517
|
+
r17 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3518
|
+
@index += 1
|
3422
3519
|
else
|
3423
|
-
terminal_parse_failure("
|
3520
|
+
terminal_parse_failure("α")
|
3424
3521
|
r17 = nil
|
3425
3522
|
end
|
3426
3523
|
if r17
|
3427
3524
|
r1 = r17
|
3428
3525
|
r1.extend(Rank0)
|
3429
3526
|
else
|
3430
|
-
if input.index("
|
3431
|
-
r18 = instantiate_node(SyntaxNode,input, index...(index +
|
3432
|
-
@index +=
|
3527
|
+
if input.index("ββ", index) == index
|
3528
|
+
r18 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3529
|
+
@index += 2
|
3433
3530
|
else
|
3434
|
-
terminal_parse_failure("
|
3531
|
+
terminal_parse_failure("ββ")
|
3435
3532
|
r18 = nil
|
3436
3533
|
end
|
3437
3534
|
if r18
|
3438
3535
|
r1 = r18
|
3439
3536
|
r1.extend(Rank0)
|
3440
3537
|
else
|
3441
|
-
if input.index("
|
3538
|
+
if input.index("β", index) == index
|
3442
3539
|
r19 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3443
3540
|
@index += 1
|
3444
3541
|
else
|
3445
|
-
terminal_parse_failure("
|
3542
|
+
terminal_parse_failure("β")
|
3446
3543
|
r19 = nil
|
3447
3544
|
end
|
3448
3545
|
if r19
|
3449
3546
|
r1 = r19
|
3450
3547
|
r1.extend(Rank0)
|
3451
3548
|
else
|
3452
|
-
if input.index("
|
3549
|
+
if input.index("γ", index) == index
|
3453
3550
|
r20 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3454
3551
|
@index += 1
|
3455
3552
|
else
|
3456
|
-
terminal_parse_failure("
|
3553
|
+
terminal_parse_failure("γ")
|
3457
3554
|
r20 = nil
|
3458
3555
|
end
|
3459
3556
|
if r20
|
3460
3557
|
r1 = r20
|
3461
3558
|
r1.extend(Rank0)
|
3462
3559
|
else
|
3463
|
-
if input.index("
|
3560
|
+
if input.index("δ", index) == index
|
3464
3561
|
r21 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3465
3562
|
@index += 1
|
3466
3563
|
else
|
3467
|
-
terminal_parse_failure("
|
3564
|
+
terminal_parse_failure("δ")
|
3468
3565
|
r21 = nil
|
3469
3566
|
end
|
3470
3567
|
if r21
|
3471
3568
|
r1 = r21
|
3472
3569
|
r1.extend(Rank0)
|
3473
3570
|
else
|
3474
|
-
if input.index("
|
3571
|
+
if input.index("ε", index) == index
|
3475
3572
|
r22 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3476
3573
|
@index += 1
|
3477
3574
|
else
|
3478
|
-
terminal_parse_failure("
|
3575
|
+
terminal_parse_failure("ε")
|
3479
3576
|
r22 = nil
|
3480
3577
|
end
|
3481
3578
|
if r22
|
3482
3579
|
r1 = r22
|
3483
3580
|
r1.extend(Rank0)
|
3484
3581
|
else
|
3485
|
-
if input.index("
|
3582
|
+
if input.index("φ", index) == index
|
3486
3583
|
r23 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3487
3584
|
@index += 1
|
3488
3585
|
else
|
3489
|
-
terminal_parse_failure("
|
3586
|
+
terminal_parse_failure("φ")
|
3490
3587
|
r23 = nil
|
3491
3588
|
end
|
3492
3589
|
if r23
|
3493
3590
|
r1 = r23
|
3494
3591
|
r1.extend(Rank0)
|
3495
3592
|
else
|
3496
|
-
if input.index("
|
3593
|
+
if input.index("θ", index) == index
|
3497
3594
|
r24 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3498
3595
|
@index += 1
|
3499
3596
|
else
|
3500
|
-
terminal_parse_failure("
|
3597
|
+
terminal_parse_failure("θ")
|
3501
3598
|
r24 = nil
|
3502
3599
|
end
|
3503
3600
|
if r24
|
3504
3601
|
r1 = r24
|
3505
3602
|
r1.extend(Rank0)
|
3506
3603
|
else
|
3507
|
-
if input.index("
|
3508
|
-
r25 = instantiate_node(SyntaxNode,input, index...(index +
|
3509
|
-
@index +=
|
3604
|
+
if input.index("μ", index) == index
|
3605
|
+
r25 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3606
|
+
@index += 1
|
3510
3607
|
else
|
3511
|
-
terminal_parse_failure("
|
3608
|
+
terminal_parse_failure("μ")
|
3512
3609
|
r25 = nil
|
3513
3610
|
end
|
3514
3611
|
if r25
|
3515
3612
|
r1 = r25
|
3516
3613
|
r1.extend(Rank0)
|
3517
3614
|
else
|
3518
|
-
if input.index("
|
3615
|
+
if input.index("a.", index) == index
|
3519
3616
|
r26 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3520
3617
|
@index += 2
|
3521
3618
|
else
|
3522
|
-
terminal_parse_failure("
|
3619
|
+
terminal_parse_failure("a.")
|
3523
3620
|
r26 = nil
|
3524
3621
|
end
|
3525
3622
|
if r26
|
3526
3623
|
r1 = r26
|
3527
3624
|
r1.extend(Rank0)
|
3528
3625
|
else
|
3529
|
-
if input.index("
|
3626
|
+
if input.index("b.", index) == index
|
3530
3627
|
r27 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3531
3628
|
@index += 2
|
3532
3629
|
else
|
3533
|
-
terminal_parse_failure("
|
3630
|
+
terminal_parse_failure("b.")
|
3534
3631
|
r27 = nil
|
3535
3632
|
end
|
3536
3633
|
if r27
|
3537
3634
|
r1 = r27
|
3538
3635
|
r1.extend(Rank0)
|
3539
3636
|
else
|
3540
|
-
if input.index("
|
3637
|
+
if input.index("c.", index) == index
|
3541
3638
|
r28 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3542
3639
|
@index += 2
|
3543
3640
|
else
|
3544
|
-
terminal_parse_failure("
|
3641
|
+
terminal_parse_failure("c.")
|
3545
3642
|
r28 = nil
|
3546
3643
|
end
|
3547
3644
|
if r28
|
3548
3645
|
r1 = r28
|
3549
3646
|
r1.extend(Rank0)
|
3550
3647
|
else
|
3551
|
-
if input.index("
|
3648
|
+
if input.index("d.", index) == index
|
3552
3649
|
r29 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3553
3650
|
@index += 2
|
3554
3651
|
else
|
3555
|
-
terminal_parse_failure("
|
3652
|
+
terminal_parse_failure("d.")
|
3556
3653
|
r29 = nil
|
3557
3654
|
end
|
3558
3655
|
if r29
|
3559
3656
|
r1 = r29
|
3560
3657
|
r1.extend(Rank0)
|
3561
3658
|
else
|
3562
|
-
if input.index("
|
3659
|
+
if input.index("e.", index) == index
|
3563
3660
|
r30 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3564
3661
|
@index += 2
|
3565
3662
|
else
|
3566
|
-
terminal_parse_failure("
|
3663
|
+
terminal_parse_failure("e.")
|
3567
3664
|
r30 = nil
|
3568
3665
|
end
|
3569
3666
|
if r30
|
3570
3667
|
r1 = r30
|
3571
3668
|
r1.extend(Rank0)
|
3572
3669
|
else
|
3573
|
-
if input.index("
|
3670
|
+
if input.index("g.", index) == index
|
3574
3671
|
r31 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3575
3672
|
@index += 2
|
3576
3673
|
else
|
3577
|
-
terminal_parse_failure("
|
3674
|
+
terminal_parse_failure("g.")
|
3578
3675
|
r31 = nil
|
3579
3676
|
end
|
3580
3677
|
if r31
|
3581
3678
|
r1 = r31
|
3582
3679
|
r1.extend(Rank0)
|
3583
3680
|
else
|
3584
|
-
if input.index("
|
3585
|
-
r32 = instantiate_node(SyntaxNode,input, index...(index +
|
3586
|
-
@index +=
|
3681
|
+
if input.index("k.", index) == index
|
3682
|
+
r32 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3683
|
+
@index += 2
|
3587
3684
|
else
|
3588
|
-
terminal_parse_failure("
|
3685
|
+
terminal_parse_failure("k.")
|
3589
3686
|
r32 = nil
|
3590
3687
|
end
|
3591
3688
|
if r32
|
3592
3689
|
r1 = r32
|
3593
3690
|
r1.extend(Rank0)
|
3594
3691
|
else
|
3595
|
-
if input.index("
|
3596
|
-
r33 = instantiate_node(SyntaxNode,input, index...(index +
|
3597
|
-
@index +=
|
3692
|
+
if input.index("****", index) == index
|
3693
|
+
r33 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
3694
|
+
@index += 4
|
3598
3695
|
else
|
3599
|
-
terminal_parse_failure("
|
3696
|
+
terminal_parse_failure("****")
|
3600
3697
|
r33 = nil
|
3601
3698
|
end
|
3602
3699
|
if r33
|
3603
3700
|
r1 = r33
|
3604
3701
|
r1.extend(Rank0)
|
3605
3702
|
else
|
3606
|
-
if input.index("
|
3607
|
-
r34 = instantiate_node(SyntaxNode,input, index...(index +
|
3608
|
-
@index +=
|
3703
|
+
if input.index("**", index) == index
|
3704
|
+
r34 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3705
|
+
@index += 2
|
3609
3706
|
else
|
3610
|
-
terminal_parse_failure("
|
3707
|
+
terminal_parse_failure("**")
|
3611
3708
|
r34 = nil
|
3612
3709
|
end
|
3613
3710
|
if r34
|
3614
3711
|
r1 = r34
|
3615
3712
|
r1.extend(Rank0)
|
3616
3713
|
else
|
3617
|
-
|
3618
|
-
|
3714
|
+
if input.index("*", index) == index
|
3715
|
+
r35 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3716
|
+
@index += 1
|
3717
|
+
else
|
3718
|
+
terminal_parse_failure("*")
|
3719
|
+
r35 = nil
|
3720
|
+
end
|
3721
|
+
if r35
|
3722
|
+
r1 = r35
|
3723
|
+
r1.extend(Rank0)
|
3724
|
+
else
|
3725
|
+
self.index = i1
|
3726
|
+
r1 = nil
|
3727
|
+
end
|
3619
3728
|
end
|
3620
3729
|
end
|
3621
3730
|
end
|
@@ -3652,9 +3761,9 @@ module ScientificNameClean
|
|
3652
3761
|
if r1
|
3653
3762
|
r0 = r1
|
3654
3763
|
else
|
3655
|
-
|
3656
|
-
if
|
3657
|
-
r0 =
|
3764
|
+
r36 = _nt_rank_forma
|
3765
|
+
if r36
|
3766
|
+
r0 = r36
|
3658
3767
|
else
|
3659
3768
|
self.index = i0
|
3660
3769
|
r0 = nil
|
@@ -4101,6 +4210,10 @@ module ScientificNameClean
|
|
4101
4210
|
"(" + a.value + ")"
|
4102
4211
|
end
|
4103
4212
|
|
4213
|
+
def canonical
|
4214
|
+
''
|
4215
|
+
end
|
4216
|
+
|
4104
4217
|
def pos
|
4105
4218
|
{a.interval.begin => ['subgenus', a.interval.end]}
|
4106
4219
|
end
|
@@ -4205,7 +4318,7 @@ module ScientificNameClean
|
|
4205
4318
|
" " + text_value + " " + a.value
|
4206
4319
|
end
|
4207
4320
|
def canonical(a)
|
4208
|
-
"
|
4321
|
+
""
|
4209
4322
|
end
|
4210
4323
|
def details(a = nil)
|
4211
4324
|
{:subgenus => [{:rank => text_value, :value => (a.value rescue nil)}]}
|
@@ -5412,3 +5525,4 @@ end
|
|
5412
5525
|
class ScientificNameCleanParser < Treetop::Runtime::CompiledParser
|
5413
5526
|
include ScientificNameClean
|
5414
5527
|
end
|
5528
|
+
|