biodiversity 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/parserver +15 -14
- metadata +6 -6
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
data/bin/parserver
CHANGED
@@ -79,20 +79,21 @@ puts "Running parser service on port #{OPTIONS[:port]}, output type is '#{OPTION
|
|
79
79
|
parser = ScientificNameParser.new
|
80
80
|
server = TCPServer.open(OPTIONS[:port]) # Socket to listen on a port
|
81
81
|
loop do # Servers run forever
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
82
|
+
Thread.start(server.accept) do |client|
|
83
|
+
puts 'opening client'
|
84
|
+
count = 0
|
85
|
+
while a = client.readline rescue nil
|
86
|
+
count += 1
|
87
|
+
puts "parsed %s'th name" % count if count % 1000 == 0
|
88
|
+
a.force_encoding("utf-8") if a && RUBY_VERSION_INT >= 19
|
89
|
+
if ['end','exit','q', '.'].include? a.strip
|
90
|
+
client.close
|
91
|
+
break
|
92
|
+
end
|
93
|
+
out = get_output(a, parser).strip
|
94
|
+
client.write(out + "\n") rescue break
|
92
95
|
end
|
93
|
-
|
94
|
-
client.
|
96
|
+
puts 'closing client'
|
97
|
+
client.close
|
95
98
|
end
|
96
|
-
puts 'closing client'
|
97
|
-
client.close
|
98
99
|
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:
|
5
|
-
prerelease:
|
4
|
+
hash: 31
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.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: 2011-
|
18
|
+
date: 2011-08-03 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements: []
|
128
128
|
|
129
129
|
rubyforge_project:
|
130
|
-
rubygems_version: 1.
|
130
|
+
rubygems_version: 1.5.2
|
131
131
|
signing_key:
|
132
132
|
specification_version: 3
|
133
133
|
summary: Parser of scientific names
|