rley 0.6.07 → 0.6.08
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/NLP/nano_eng/nano_en_demo.rb +32 -15
- data/lib/rley/constants.rb +1 -1
- data/lib/rley/engine.rb +47 -18
- data/lib/rley/formatter/debug.rb +21 -71
- data/lib/rley/parse_forest_visitor.rb +112 -28
- data/lib/rley/parse_rep/parse_rep_creator.rb +4 -2
- data/lib/rley/parse_tree_visitor.rb +3 -3
- data/lib/rley/ptree/parse_tree.rb +3 -3
- data/lib/rley/sppf/alternative_node.rb +6 -0
- data/lib/rley/sppf/composite_node.rb +2 -0
- data/lib/rley/sppf/epsilon_node.rb +6 -0
- data/lib/rley/sppf/non_terminal_node.rb +9 -3
- data/lib/rley/sppf/parse_forest.rb +12 -1
- data/lib/rley/sppf/token_node.rb +6 -0
- data/spec/rley/engine_spec.rb +32 -6
- data/spec/rley/formatter/debug_spec.rb +126 -13
- data/spec/rley/parse_forest_visitor_spec.rb +357 -129
- data/spec/rley/parse_rep/parse_forest_factory_spec.rb +0 -9
- data/spec/rley/parse_tree_visitor_spec.rb +2 -1
- metadata +2 -2
@@ -42,7 +42,6 @@ module Rley # Open this namespace to avoid module qualifier prefixes
|
|
42
42
|
parser.parse(sample_tokens)
|
43
43
|
end
|
44
44
|
|
45
|
-
|
46
45
|
subject do
|
47
46
|
ParseForestFactory.new(sample_result)
|
48
47
|
end
|
@@ -55,7 +54,6 @@ module Rley # Open this namespace to avoid module qualifier prefixes
|
|
55
54
|
return text_parts.join('/')
|
56
55
|
end
|
57
56
|
|
58
|
-
|
59
57
|
context 'Initialization:' do
|
60
58
|
it 'should be created with a GFGParsing' do
|
61
59
|
expect { ParseForestFactory.new(sample_result) }.not_to raise_error
|
@@ -70,13 +68,6 @@ module Rley # Open this namespace to avoid module qualifier prefixes
|
|
70
68
|
it 'should build a parse forest' do
|
71
69
|
forest = subject.create
|
72
70
|
expect(forest).to be_kind_of(SPPF::ParseForest)
|
73
|
-
=begin
|
74
|
-
require 'yaml'
|
75
|
-
require_relative '../../../exp/lab/forest_representation'
|
76
|
-
File.open("forest.yml", "w") { |f| YAML.dump(forest, f) }
|
77
|
-
pen = ForestRepresentation.new
|
78
|
-
pen.generate_graph(forest, File.open("forest.dot", "w"))
|
79
|
-
=end
|
80
71
|
end
|
81
72
|
end # context
|
82
73
|
end # describe
|
@@ -1,9 +1,10 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
require_relative './support/grammar_abc_helper'
|
4
3
|
require_relative '../../lib/rley/lexical/token'
|
5
4
|
require_relative '../../lib/rley/parser/gfg_earley_parser'
|
6
5
|
require_relative '../../lib/rley/engine'
|
6
|
+
require_relative './support/grammar_abc_helper'
|
7
|
+
require_relative './support/grammar_sppf_helper'
|
7
8
|
# Load the class under test
|
8
9
|
require_relative '../../lib/rley/parse_tree_visitor'
|
9
10
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rley
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.08
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|