langusta 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/langusta +1 -1
- data/langusta.gemspec +1 -7
- data/lib/langusta.rb +1 -4
- data/lib/langusta/detector.rb +0 -19
- metadata +4 -26
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/bin/langusta
CHANGED
data/langusta.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "langusta"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jan Szumiec"]
|
@@ -168,19 +168,13 @@ Gem::Specification.new do |s|
|
|
168
168
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
169
169
|
s.add_runtime_dependency(%q<oniguruma>, ["= 1.1.0"]) if RUBY_VERSION < "1.9"
|
170
170
|
s.add_runtime_dependency(%q<yajl-ruby>, ["= 0.8.2"])
|
171
|
-
s.add_runtime_dependency(%q<bundler>, [">= 0"])
|
172
|
-
s.add_runtime_dependency(%q<jeweler>, [">= 0"])
|
173
171
|
else
|
174
172
|
s.add_dependency(%q<oniguruma>, ["= 1.1.0"]) if RUBY_VERSION < "1.9"
|
175
173
|
s.add_dependency(%q<yajl-ruby>, ["= 0.8.2"])
|
176
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
177
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
178
174
|
end
|
179
175
|
else
|
180
176
|
s.add_dependency(%q<oniguruma>, ["= 1.1.0"]) if RUBY_VERSION < "1.9"
|
181
177
|
s.add_dependency(%q<yajl-ruby>, ["= 0.8.2"])
|
182
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
183
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
184
178
|
end
|
185
179
|
end
|
186
180
|
|
data/lib/langusta.rb
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
$: << File.expand_path(File.dirname(__FILE__))
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
Bundler.require
|
6
4
|
|
7
5
|
require 'optparse'
|
8
6
|
require 'iconv' if RUBY_VERSION < "1.9"
|
7
|
+
require 'yajl'
|
9
8
|
|
10
9
|
module Langusta
|
11
|
-
VERSION = '0.1.1'
|
12
|
-
|
13
10
|
autoload :Guard, 'langusta/guard'
|
14
11
|
autoload :Inspector, 'langusta/inspector'
|
15
12
|
autoload :RegexHelper, 'langusta/regex_helper'
|
data/lib/langusta/detector.rb
CHANGED
@@ -70,25 +70,6 @@ module Langusta
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
# TODO: this looks like it's not referenced anywhere.
|
74
|
-
def set_prior_map(prior_map)
|
75
|
-
@prior_map = Array.new[@lang_list.length]
|
76
|
-
sump = 0.0
|
77
|
-
@prior_map.length.times do |i|
|
78
|
-
lang = @lang_list[i]
|
79
|
-
if @prior_map.has_key?(lang)
|
80
|
-
p = @prior_map[lang]
|
81
|
-
raise "probability must be non-negative" if p < 0
|
82
|
-
@prior_map[i] = p
|
83
|
-
sump += p
|
84
|
-
end
|
85
|
-
end
|
86
|
-
raise "more one of prob must be non-zero" if sump <= 0
|
87
|
-
@prior_map.map! do |p|
|
88
|
-
p /= sump
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
73
|
def self.normalize_prob(prob)
|
93
74
|
maxp = 0.0; sump = 0.0
|
94
75
|
prob.each do |p|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: langusta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-04 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yajl-ruby
|
16
|
-
requirement: &
|
16
|
+
requirement: &2153287340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,29 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.8.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: bundler
|
27
|
-
requirement: &2152184160 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
|
-
requirements:
|
30
|
-
- - ! '>='
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
33
|
-
type: :runtime
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *2152184160
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: jeweler
|
38
|
-
requirement: &2152182040 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ! '>='
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '0'
|
44
|
-
type: :runtime
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *2152182040
|
24
|
+
version_requirements: *2153287340
|
47
25
|
description: Highly accurate language detection library, uses naive bayesian filter.
|
48
26
|
email: jan.szumiec@gmail.com
|
49
27
|
executables:
|
@@ -211,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
189
|
version: '0'
|
212
190
|
requirements: []
|
213
191
|
rubyforge_project:
|
214
|
-
rubygems_version: 1.8.
|
192
|
+
rubygems_version: 1.8.10
|
215
193
|
signing_key:
|
216
194
|
specification_version: 3
|
217
195
|
summary: Language detection library based on http://code.google.com/p/language-detection/.
|