24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/taxt.rb', line 24
def self.encode_taxon_name name, rank, data = {}
name = name.dup
if data[:suborder_name]
return "#{Formatters::CatalogFormatter.fossil(name, data[:fossil])} (#{data[:suborder_name]})"
end
if rank == :species_group_epithet
string = '<i>'.html_safe
string << Formatters::CatalogFormatter.fossil(name, data[:fossil])
string << '</i>'.html_safe
return string
end
if data[:genus_abbreviation]
string = '<i>'.html_safe
string << Formatters::CatalogFormatter.fossil(data[:genus_abbreviation], data[:fossil])
if data[:species_epithet]
string << ' ' << data[:species_epithet]
elsif data[:subgenus_epithet]
string << ' (' << data[:subgenus_epithet] << ')'
else raise
end
string << '</i>'.html_safe
return string
end
italicize = [:collective_group, :genus].include? rank
if rank == :genus && data[:species_epithet]
if data [:subgenus_epithet]
name += " (#{data[:subgenus_epithet]})"
end
name += ' ' + data[:species_epithet]
end
output = ''
output << '<i>' if italicize
output << Formatters::CatalogFormatter.fossil(name, data[:fossil])
output << '?' if data[:questionable]
output << '</i>' if italicize
output
end
|