dimus-biodiversity 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile
CHANGED
@@ -9,6 +9,21 @@ require 'rake/gempackagetask'
|
|
9
9
|
|
10
10
|
task :default => :spec
|
11
11
|
|
12
|
+
#begin
|
13
|
+
# require 'jeweler'
|
14
|
+
# Jeweler::Tasks.new do |gemspec|
|
15
|
+
# gemspec.name = "biodiversity"
|
16
|
+
# gemspec.summary = "scientific species name parser\n\nExecutable is nnparse"
|
17
|
+
# gemspec.email = "dmozzherin {et} eol {dt} org"
|
18
|
+
# gemspec.homepage = "http://github.com/dimus/biodiversity"
|
19
|
+
# gemspec.description = "Biodiversity library provides a parser tool for scientific species names"
|
20
|
+
# gemspec.authors = ["Dmitry Mozzherin", "Anna Shipunova"]
|
21
|
+
# end
|
22
|
+
#rescue LoadError
|
23
|
+
# puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
24
|
+
#end
|
25
|
+
|
26
|
+
|
12
27
|
|
13
28
|
task :tt do
|
14
29
|
system("tt #{dir}/lib/biodiversity/parser/scientific_name.treetop")
|
data/lib/biodiversity/parser.rb
CHANGED
@@ -3522,6 +3522,9 @@ module ScientificName
|
|
3522
3522
|
def value
|
3523
3523
|
a.text_value + b.value
|
3524
3524
|
end
|
3525
|
+
def details
|
3526
|
+
{}
|
3527
|
+
end
|
3525
3528
|
end
|
3526
3529
|
|
3527
3530
|
module LatinWord2
|
@@ -3538,6 +3541,9 @@ module ScientificName
|
|
3538
3541
|
def value
|
3539
3542
|
a.value + b.value
|
3540
3543
|
end
|
3544
|
+
def details
|
3545
|
+
{}
|
3546
|
+
end
|
3541
3547
|
end
|
3542
3548
|
|
3543
3549
|
def _nt_latin_word
|
@@ -3614,6 +3620,9 @@ module ScientificName
|
|
3614
3620
|
def value
|
3615
3621
|
a.value + b.value
|
3616
3622
|
end
|
3623
|
+
def details
|
3624
|
+
{}
|
3625
|
+
end
|
3617
3626
|
end
|
3618
3627
|
|
3619
3628
|
module FullNameLetters2
|
@@ -3634,6 +3643,9 @@ module ScientificName
|
|
3634
3643
|
def value
|
3635
3644
|
a.value + b.value + c.value
|
3636
3645
|
end
|
3646
|
+
def details
|
3647
|
+
{}
|
3648
|
+
end
|
3637
3649
|
end
|
3638
3650
|
|
3639
3651
|
def _nt_full_name_letters
|
@@ -3704,6 +3716,9 @@ module ScientificName
|
|
3704
3716
|
def value
|
3705
3717
|
text_value
|
3706
3718
|
end
|
3719
|
+
def details
|
3720
|
+
{}
|
3721
|
+
end
|
3707
3722
|
end
|
3708
3723
|
|
3709
3724
|
def _nt_valid_name_letters
|
@@ -3796,6 +3811,9 @@ module ScientificName
|
|
3796
3811
|
def value
|
3797
3812
|
"x"
|
3798
3813
|
end
|
3814
|
+
def details
|
3815
|
+
{}
|
3816
|
+
end
|
3799
3817
|
end
|
3800
3818
|
|
3801
3819
|
def _nt_hybrid_separator
|
@@ -3976,6 +3994,13 @@ module ScientificName
|
|
3976
3994
|
return r0
|
3977
3995
|
end
|
3978
3996
|
|
3997
|
+
module Space0
|
3998
|
+
def details
|
3999
|
+
{
|
4000
|
+
}
|
4001
|
+
end
|
4002
|
+
end
|
4003
|
+
|
3979
4004
|
def _nt_space
|
3980
4005
|
start_index = index
|
3981
4006
|
if node_cache[:space].has_key?(index)
|
@@ -3999,12 +4024,19 @@ module ScientificName
|
|
3999
4024
|
end
|
4000
4025
|
end
|
4001
4026
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
4027
|
+
r0.extend(Space0)
|
4002
4028
|
|
4003
4029
|
node_cache[:space][start_index] = r0
|
4004
4030
|
|
4005
4031
|
return r0
|
4006
4032
|
end
|
4007
4033
|
|
4034
|
+
module SpaceHard0
|
4035
|
+
def details
|
4036
|
+
{}
|
4037
|
+
end
|
4038
|
+
end
|
4039
|
+
|
4008
4040
|
def _nt_space_hard
|
4009
4041
|
start_index = index
|
4010
4042
|
if node_cache[:space_hard].has_key?(index)
|
@@ -4032,6 +4064,7 @@ module ScientificName
|
|
4032
4064
|
r0 = nil
|
4033
4065
|
else
|
4034
4066
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
4067
|
+
r0.extend(SpaceHard0)
|
4035
4068
|
end
|
4036
4069
|
|
4037
4070
|
node_cache[:space_hard][start_index] = r0
|
@@ -522,12 +522,18 @@ grammar ScientificName
|
|
522
522
|
def value
|
523
523
|
a.text_value + b.value
|
524
524
|
end
|
525
|
+
def details
|
526
|
+
{}
|
527
|
+
end
|
525
528
|
}
|
526
529
|
/
|
527
530
|
a:digraph b:full_name_letters {
|
528
531
|
def value
|
529
532
|
a.value + b.value
|
530
533
|
end
|
534
|
+
def details
|
535
|
+
{}
|
536
|
+
end
|
531
537
|
}
|
532
538
|
end
|
533
539
|
|
@@ -536,12 +542,18 @@ grammar ScientificName
|
|
536
542
|
def value
|
537
543
|
a.value + b.value
|
538
544
|
end
|
545
|
+
def details
|
546
|
+
{}
|
547
|
+
end
|
539
548
|
}
|
540
549
|
/
|
541
550
|
a:valid_name_letters b:digraph c:full_name_letters {
|
542
551
|
def value
|
543
552
|
a.value + b.value + c.value
|
544
553
|
end
|
554
|
+
def details
|
555
|
+
{}
|
556
|
+
end
|
545
557
|
}
|
546
558
|
/
|
547
559
|
valid_name_letters
|
@@ -552,6 +564,9 @@ grammar ScientificName
|
|
552
564
|
def value
|
553
565
|
text_value
|
554
566
|
end
|
567
|
+
def details
|
568
|
+
{}
|
569
|
+
end
|
555
570
|
}
|
556
571
|
end
|
557
572
|
|
@@ -574,6 +589,9 @@ grammar ScientificName
|
|
574
589
|
def value
|
575
590
|
"x"
|
576
591
|
end
|
592
|
+
def details
|
593
|
+
{}
|
594
|
+
end
|
577
595
|
}
|
578
596
|
end
|
579
597
|
|
@@ -602,10 +620,19 @@ grammar ScientificName
|
|
602
620
|
end
|
603
621
|
|
604
622
|
rule space
|
605
|
-
[\s]*
|
623
|
+
[\s]* {
|
624
|
+
def details
|
625
|
+
{
|
626
|
+
}
|
627
|
+
end
|
628
|
+
}
|
606
629
|
end
|
607
630
|
|
608
631
|
rule space_hard
|
609
|
-
[\s]+
|
632
|
+
[\s]+ {
|
633
|
+
def details
|
634
|
+
{}
|
635
|
+
end
|
636
|
+
}
|
610
637
|
end
|
611
638
|
end
|