biodiversity 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +25 -0
  2. data/VERSION +1 -1
  3. data/bin/parserver +4 -1
  4. metadata +4 -4
@@ -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
@@ -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,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biodiversity
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 3
10
- version: 0.6.3
9
+ - 4
10
+ version: 0.6.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dmitry Mozzherin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-26 00:00:00 -04:00
18
+ date: 2010-08-07 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency