sequitur 0.0.05 → 0.0.06
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 +8 -8
- data/.rubocop.yml +0 -3
- data/CHANGELOG.md +3 -0
- data/README.md +2 -0
- data/lib/sequitur/constants.rb +1 -1
- data/lib/sequitur/{dynamic-grammar.rb → dynamic_grammar.rb} +1 -1
- data/lib/sequitur/{sequitur-grammar.rb → sequitur_grammar.rb} +4 -4
- data/spec/sequitur/{dynamic-grammar_spec.rb → dynamic_grammar_spec.rb} +1 -1
- data/spec/sequitur/{sequitur-grammar_spec.rb → sequitur_grammar_spec.rb} +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWU5NWNmNThiYzM0M2UxOWU2ZGY4Mzc3ZTkzOWM2NGM2M2ZkNGYyYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDk3ZjQ3NGM0NTFjZDM4NzIzOGExMDdjZDIwYTA4NTZiNmY3YTEwYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDFmZWEzZWQ1MWIzNzg4YTA3MmZhNDc1ZTkxYjE1ODY3MzgyMzlhMWI0MDVm
|
10
|
+
MDUwMTY1OTI0ZTkxYzhjZGEwYWRjNTVjMWZkNzkxMzgxNjQ3ZjcwZmQ2NmI0
|
11
|
+
Y2VmYTA3NzhjMjg0NTE3ZGU2YzNlNjU3Mjk5NTBhMTA0ODQ5M2Y=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGNhMmUzZTEyOWQ5N2QyZGExOTljMzJmMmZmNGVjMjRjNjU2NzkyN2EwOTg1
|
14
|
+
YzU0YTcwYzc3OWI0MDdhNjY4NDVjZmVhYzZhMGE4YjY3NDM5NTY4M2NhZDhi
|
15
|
+
MTZhYmQyNmZkMzhjZjIzZDE2NjVkZDhmM2Y4NWZiOGViNzg1MzM=
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -6,6 +6,8 @@ _Ruby gem implementing the Sequitur algorithm_
|
|
6
6
|
[](https://travis-ci.org/famished-tiger/Sequitur)
|
7
7
|
[](http://badge.fury.io/rb/sequitur)
|
8
8
|
|
9
|
+
### TODO: add documentation ###
|
10
|
+
|
9
11
|
Copyright
|
10
12
|
---------
|
11
13
|
Copyright (c) 2014, Dimitri Geshef. Sequitur is released under the MIT License see [LICENSE.txt](https://github.com/famished-tiger/Sequitur/blob/master/LICENSE.txt) for details.
|
data/lib/sequitur/constants.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative 'dynamic_grammar'
|
2
2
|
|
3
3
|
module Sequitur # Module for classes implementing the Sequitur algorithm
|
4
4
|
|
@@ -203,11 +203,11 @@ class SequiturGrammar < DynamicGrammar
|
|
203
203
|
check_references
|
204
204
|
|
205
205
|
loop do
|
206
|
-
|
206
|
+
all_refcount_ok = true
|
207
207
|
(1...productions.size).to_a.reverse.each do |index|
|
208
208
|
next unless productions[index].refcount == 1
|
209
209
|
|
210
|
-
|
210
|
+
all_refcount_ok = false
|
211
211
|
other_id = productions[index].backrefs.keys.first
|
212
212
|
dependent = ObjectSpace._id2ref(other_id)
|
213
213
|
dependent.replace_production(productions[index])
|
@@ -217,7 +217,7 @@ class SequiturGrammar < DynamicGrammar
|
|
217
217
|
check_backrefs
|
218
218
|
end
|
219
219
|
|
220
|
-
break if
|
220
|
+
break if all_refcount_ok
|
221
221
|
end
|
222
222
|
end
|
223
223
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequitur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.06
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
@@ -88,13 +88,13 @@ files:
|
|
88
88
|
- lib/sequitur.rb
|
89
89
|
- lib/sequitur/constants.rb
|
90
90
|
- lib/sequitur/digram.rb
|
91
|
-
- lib/sequitur/
|
91
|
+
- lib/sequitur/dynamic_grammar.rb
|
92
92
|
- lib/sequitur/production.rb
|
93
|
-
- lib/sequitur/
|
93
|
+
- lib/sequitur/sequitur_grammar.rb
|
94
94
|
- spec/sequitur/digram_spec.rb
|
95
|
-
- spec/sequitur/
|
95
|
+
- spec/sequitur/dynamic_grammar_spec.rb
|
96
96
|
- spec/sequitur/production_spec.rb
|
97
|
-
- spec/sequitur/
|
97
|
+
- spec/sequitur/sequitur_grammar_spec.rb
|
98
98
|
- spec/spec_helper.rb
|
99
99
|
homepage: https://github.com/famished-tiger/Sequitur
|
100
100
|
licenses:
|
@@ -129,6 +129,6 @@ specification_version: 4
|
|
129
129
|
summary: Ruby implementation of the Sequitur algorithm
|
130
130
|
test_files:
|
131
131
|
- spec/sequitur/digram_spec.rb
|
132
|
-
- spec/sequitur/
|
132
|
+
- spec/sequitur/dynamic_grammar_spec.rb
|
133
133
|
- spec/sequitur/production_spec.rb
|
134
|
-
- spec/sequitur/
|
134
|
+
- spec/sequitur/sequitur_grammar_spec.rb
|