biodiversity19 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/README.rdoc +25 -0
  2. data/VERSION +1 -1
  3. data/bin/parserver +4 -1
  4. metadata +7 -12
data/README.rdoc CHANGED
@@ -11,10 +11,35 @@ To install gem you need RubyGems >= 1.3.6
11
11
 
12
12
  == Example usage
13
13
 
14
+ === As a command line script
15
+
14
16
  You can parse file with taxonomic names from command line. File should contain one scientific name per line
15
17
 
16
18
  nnparser file_with_names
19
+
20
+ === As a socket server
21
+
22
+ If you do not use ruby and need a fast access to the parser functionality you can use a socket server
23
+
24
+ parserver
25
+
26
+ Then you can access it via 4334 port using a socket client library of your programming language. If you want to check if socket server works for you try:
17
27
 
28
+ telnet localhost 4334
29
+
30
+ If you enter a line with a scientific name server will send you back parsed information in json format.
31
+
32
+ To stop telnet client type any of 'end','exit','q', '.' (without quotes) instead of scientific name
33
+
34
+ $ telnet localhost 4334
35
+ Trying ::1...
36
+ Connected to localhost.
37
+ Escape character is '^]'.
38
+ Acacia abyssinica Hochst. ex Benth. ssp. calophylla Brenan
39
+ {"scientificName":{"canonical":"Acacia abyssinica calophylla","parsed":true,"parser_run":1,"verbatim":"Acacia abyssinica Hochst. ex Benth. ssp. calophylla Brenan\r\n","positions":{"0":["genus",6],"18":["author_word",25],"29":["author_word",35],"7":["species",17],"41":["infraspecies",51],"52":["author_word",58]},"hybrid":false,"normalized":"Acacia abyssinica Hochst. ex Benth. ssp. calophylla Brenan","details":[{"species":{"basionymAuthorTeam":{"exAuthorTeam":{"author":["Benth."],"authorTeam":"Benth."},"author":["Hochst."],"authorTeam":"Hochst."},"string":"abyssinica","authorship":"Hochst. ex Benth."},"infraspecies":[{"basionymAuthorTeam":{"author":["Brenan"],"authorTeam":"Brenan"},"string":"calophylla","rank":"ssp.","authorship":"Brenan"}],"genus":{"string":"Acacia"}}]}}
40
+
41
+ === As a library
42
+
18
43
  You can use it as a library
19
44
 
20
45
  require 'biodiversity'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.3
1
+ 0.6.4
data/bin/parserver CHANGED
@@ -8,7 +8,10 @@ server = TCPServer.open(4334) # Socket to listen on port 4334
8
8
  loop do # Servers run forever
9
9
  client = server.accept # Wait for a client to connect
10
10
  while a = client.readline
11
- client.close if ['end','exit','q', '.'].include? a.strip
11
+ if ['end','exit','q', '.'].include? a.strip
12
+ client.close
13
+ break
14
+ end
12
15
  client.puts parser.parse(a).to_json
13
16
  end
14
17
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biodiversity19
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 6
9
- - 3
10
- version: 0.6.3
8
+ - 4
9
+ version: 0.6.4
11
10
  platform: ruby
12
11
  authors:
13
12
  - Dmitry Mozzherin
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-05-26 00:00:00 -04:00
17
+ date: 2010-08-12 00:00:00 -04:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 3
30
28
  segments:
31
29
  - 0
32
30
  version: "0"
@@ -40,7 +38,6 @@ dependencies:
40
38
  requirements:
41
39
  - - ">="
42
40
  - !ruby/object:Gem::Version
43
- hash: 3
44
41
  segments:
45
42
  - 0
46
43
  version: "0"
@@ -97,7 +94,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
94
  requirements:
98
95
  - - ">="
99
96
  - !ruby/object:Gem::Version
100
- hash: 3
101
97
  segments:
102
98
  - 0
103
99
  version: "0"
@@ -106,7 +102,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
102
  requirements:
107
103
  - - ">="
108
104
  - !ruby/object:Gem::Version
109
- hash: 3
110
105
  segments:
111
106
  - 0
112
107
  version: "0"
@@ -118,11 +113,11 @@ signing_key:
118
113
  specification_version: 3
119
114
  summary: Parser of scientific names
120
115
  test_files:
121
- - spec/spec_helper.rb
122
- - spec/guid/lsid.spec.rb
123
116
  - spec/biodiversity_spec.rb
124
- - spec/parser/spec_helper.rb
117
+ - spec/guid/lsid.spec.rb
125
118
  - spec/parser/scientific_name.spec.rb
126
- - spec/parser/scientific_name_clean.spec.rb
127
119
  - spec/parser/scientific_name_canonical.spec.rb
120
+ - spec/parser/scientific_name_clean.spec.rb
128
121
  - spec/parser/scientific_name_dirty.spec.rb
122
+ - spec/parser/spec_helper.rb
123
+ - spec/spec_helper.rb