rlid 0.1.0

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.
@@ -0,0 +1,57 @@
1
+ module Rlid
2
+ def self.tmp_methods
3
+ @@tmp_methods
4
+ end
5
+ def self.tmp_methods= (val)
6
+ @@tmp_methods = val
7
+ end
8
+ @@tmp_methods = {}
9
+ end
10
+
11
+ class Module
12
+ def rlid_tmp_methods
13
+ Rlid.tmp_methods[self] = all_methods
14
+ end
15
+
16
+ def all_methods
17
+ public_methods + private_methods + protected_methods
18
+ end
19
+ end
20
+
21
+ class C
22
+ def c1
23
+ puts "c1"
24
+ end
25
+
26
+ def c2
27
+ "c2"
28
+ end
29
+
30
+ rlid_tmp_methods
31
+
32
+ def fff
33
+ puts "fff"
34
+ end
35
+ protected
36
+ def function(abc)
37
+ abc
38
+ end
39
+ end
40
+
41
+ module Rlid
42
+ tmp_methods.each do |cl, old_methods|
43
+ new_methods = cl.all_methods
44
+ to_be_removed = new_methods - old_methods
45
+ puts old_methods.include? :function
46
+ puts new_methods.include? :function
47
+ puts cl.protected_methods
48
+ to_be_removed.each do |m|
49
+ puts "#{cl}.#{m} "
50
+ end
51
+ end
52
+ end
53
+
54
+ puts require 'irb'
55
+
56
+
57
+ #irb self
@@ -0,0 +1,16 @@
1
+ module Rlid
2
+
3
+ class LanguageProbabilities
4
+ CLASSNAME = "languageresult"
5
+
6
+ def to_html
7
+ sorted[0...MAX_OUTPUT].map do |x|
8
+ perc = Percentage.new(x[PERC]).to_s
9
+ lang = Language.name_of(x[LANG])
10
+ "<div class='#{CLASSNAME}'>" +
11
+ "#{lang} (#{perc}% chance)</div>"
12
+ end.join("\n")
13
+ end
14
+ end
15
+
16
+ end # module Rlid
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rlid
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.1.0
6
+ platform: ruby
7
+ authors:
8
+ - Fela Winkelmolen
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-02-01 00:00:00 +01:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: Language identification library specialized in guessing the language of short strings.
18
+ email: fela.kde@gmail.com
19
+ executables: []
20
+
21
+ extensions: []
22
+
23
+ extra_rdoc_files: []
24
+
25
+ files:
26
+ - lib/interactive_guesser.rb
27
+ - lib/rlid.rb
28
+ - lib/rlid/common.rb
29
+ - lib/rlid/web.rb
30
+ - lib/rlid/tmp.rb
31
+ - lib/rlid/language_guesser/model_distance_guesser.rb
32
+ - lib/rlid/language_guesser/naive_bayes_guesser.rb
33
+ - lib/rlid/language_guesser/language_guesser.rb
34
+ - lib/rlid/models/generate_naive_bayes_models.rb
35
+ - lib/rlid/models/generate_models.rb
36
+ - lib/rlid/models/cosine_distance_model.rb
37
+ - lib/rlid/models/model.rb
38
+ - lib/rlid/models/naive_bayes_models.rb
39
+ - lib/rlid/models/ordered_ngrams.rb
40
+ - lib/rlid/probabilities/language_probabilities.rb
41
+ - data/naive_bayes_models
42
+ has_rdoc: true
43
+ homepage: https://github.com/fela/rlid
44
+ licenses: []
45
+
46
+ post_install_message:
47
+ rdoc_options: []
48
+
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 1.9.1
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ requirements: []
64
+
65
+ rubyforge_project:
66
+ rubygems_version: 1.5.0
67
+ signing_key:
68
+ specification_version: 3
69
+ summary: Language identification library
70
+ test_files: []
71
+