Top Level Namespace
Defined Under Namespace
Modules: Biodiversity, PreProcessor, ScientificNameCanonical, ScientificNameClean, ScientificNameDirty
Classes: LsidResolver, ParallelParser, ScientificNameCanonicalParser, ScientificNameCleanParser, ScientificNameDirtyParser, ScientificNameParser
Constant Summary
collapse
- DEFAULT_PORT =
4334
- RUBY_VERSION_INT =
RUBY_VERSION.split('.')[0..1].join('').to_i
- OPTIONS =
{
output: 'json',
canonical_with_rank: false,
port: DEFAULT_PORT
}
Instance Method Summary
collapse
Instance Method Details
#get_output(name_string, parser) ⇒ Object
52
53
54
55
56
57
58
59
60
61
|
# File 'bin/parserver', line 52
def get_output(name_string, parser)
begin
parsed = parser.parse(name_string)
rescue
parsed = ScientificNameParser::FAILED_RESULT.(name_string)
end
output = OPTIONS[:output]
return parsed.to_json if output == 'json'
parsed[:scientificName][:canonical].to_s
end
|
#parser_error(name) ⇒ Object
7
8
9
10
11
12
|
# File 'bin/nnparse', line 7
def parser_error(name)
{ 'scientificName' =>
{ 'parsed' => false,
'verbatim' => name,
'error' => 'Parser error' } }.to_json
end
|