lite 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/lib/lite/vmm.rb +12 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 742b530452865b11b7fc5e2d1a8658f1495937dc
|
4
|
+
data.tar.gz: 26e68df1a0a0b3fd62b54916f32c588a7f8dc46e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ed4c5a360eabbe27132970d17e93147912baa08f6af62169a3c824f468ac36948b9c1b91213323d7561d392fab2e074c12c10d4ebac24702cc90feb412d4e23
|
7
|
+
data.tar.gz: adea88de3f7721321294ba4f53c8ddfeb6401fa3bb3670a925c992dc0b2a82be57140aca9f08fe390f5ffa97376b099b84e229ab70c0a3f4b5b142d7d15193f4
|
data/lib/lite/vmm.rb
CHANGED
@@ -33,8 +33,19 @@ class PPM
|
|
33
33
|
(context[1].values.inject(:+) + context[1].size).to_f
|
34
34
|
end
|
35
35
|
|
36
|
+
def serialize
|
37
|
+
{ 'trie' => @trie.root, 'ab' => @ab.sym_arr, 'd' => @d }.to_msgpack
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.deserialize serialization_str
|
41
|
+
model = MessagePack.unpack( serialization_str )
|
42
|
+
ppm = PPM.new( model['ab'],model['d'] )
|
43
|
+
ppm.instance_variable_set( :@trie, Trie.new( model['trie'] ) )
|
44
|
+
ppm
|
45
|
+
end
|
46
|
+
|
36
47
|
def to_file file_path
|
37
|
-
msg =
|
48
|
+
msg = serialize
|
38
49
|
out = File.new( file_path, "w" )
|
39
50
|
out.print msg
|
40
51
|
out.close
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronbee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: 'lite machine learning tools:
|
13
|
+
description: 'lite machine learning tools: classifier, annotator, and more'
|
14
14
|
email: void@mailinator.com
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
@@ -32,17 +32,17 @@ require_paths:
|
|
32
32
|
- lib
|
33
33
|
required_ruby_version: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ">="
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
requirements: []
|
44
44
|
rubyforge_project:
|
45
|
-
rubygems_version: 2.0
|
45
|
+
rubygems_version: 2.2.0
|
46
46
|
signing_key:
|
47
47
|
specification_version: 4
|
48
48
|
summary: lite machine learning tools
|