calyx 0.18.0 → 0.22.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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +33 -0
- data/calyx.gemspec +2 -2
- data/examples/faker.json +1 -0
- data/examples/faker.rb +1 -1
- data/lib/calyx.rb +12 -8
- data/lib/calyx/format.rb +5 -0
- data/lib/calyx/grammar.rb +12 -0
- data/lib/calyx/mapping.rb +15 -0
- data/lib/calyx/modifiers.rb +8 -0
- data/lib/calyx/prefix_tree.rb +191 -0
- data/lib/calyx/production/affix_table.rb +53 -0
- data/lib/calyx/production/uniform_branch.rb +6 -0
- data/lib/calyx/production/weighted_branch.rb +6 -0
- data/lib/calyx/registry.rb +35 -17
- data/lib/calyx/rule.rb +25 -4
- data/lib/calyx/{production → syntax}/choices.rb +1 -1
- data/lib/calyx/{production → syntax}/concat.rb +18 -22
- data/lib/calyx/syntax/expression.rb +87 -0
- data/lib/calyx/{production → syntax}/memo.rb +1 -1
- data/lib/calyx/{production → syntax}/non_terminal.rb +1 -1
- data/lib/calyx/syntax/paired_mapping.rb +53 -0
- data/lib/calyx/{production → syntax}/terminal.rb +1 -1
- data/lib/calyx/syntax/token.rb +9 -0
- data/lib/calyx/{production → syntax}/unique.rb +1 -1
- data/lib/calyx/{production → syntax}/weighted_choices.rb +9 -2
- data/lib/calyx/version.rb +1 -1
- metadata +27 -86
- data/.travis.yml +0 -9
- data/docs/404.html +0 -7
- data/docs/CNAME +0 -1
- data/docs/_config.yml +0 -27
- data/docs/_data/breadcrumbs.yml +0 -9
- data/docs/_data/docs.yml +0 -35
- data/docs/_data/examples.yml +0 -9
- data/docs/_includes/breadcrumbs.html +0 -36
- data/docs/_includes/contents.html +0 -12
- data/docs/_includes/icon-github.html +0 -4
- data/docs/_includes/icon-rubygems.html +0 -9
- data/docs/_includes/navbar.html +0 -24
- data/docs/_includes/pagebar.html +0 -12
- data/docs/_layouts/default.html +0 -13
- data/docs/_layouts/docs.html +0 -14
- data/docs/_layouts/home.html +0 -13
- data/docs/_layouts/page.html +0 -20
- data/docs/_posts/2017-09-14-welcome-to-jekyll.markdown +0 -25
- data/docs/_posts/2017-09-21-0.17.0-released.md +0 -10
- data/docs/_styles/card.scss +0 -7
- data/docs/_styles/colors.scss +0 -18
- data/docs/_styles/content.scss +0 -57
- data/docs/_styles/cta.scss +0 -25
- data/docs/_styles/grid.scss +0 -22
- data/docs/_styles/media.scss +0 -50
- data/docs/_styles/menu.scss +0 -54
- data/docs/_styles/modifiers.scss +0 -3
- data/docs/_styles/navbar.scss +0 -161
- data/docs/_styles/pagebar.scss +0 -32
- data/docs/_styles/reset.scss +0 -92
- data/docs/_styles/scale.scss +0 -23
- data/docs/_styles/spread.scss +0 -55
- data/docs/_styles/styleguide.scss +0 -52
- data/docs/_styles/syntax.scss +0 -84
- data/docs/_styles/typography.scss +0 -49
- data/docs/_styles/yard.scss +0 -36
- data/docs/api.html +0 -9662
- data/docs/assets/calyx-docs.css +0 -792
- data/docs/assets/calyx-flower-outline.svg +0 -202
- data/docs/assets/calyx-flower-reverse.svg +0 -202
- data/docs/assets/calyx-flower.svg +0 -202
- data/docs/assets/logo-small.png +0 -0
- data/docs/assets/logos/calyx-flower-1.svg +0 -22
- data/docs/assets/logos/calyx-flower-2.svg +0 -21
- data/docs/content/documentation.html +0 -20
- data/docs/content/examples.html +0 -12
- data/docs/content/examples/any-gradient.md +0 -32
- data/docs/content/examples/faker.md +0 -16
- data/docs/content/examples/tiny-woodland-bot.md +0 -24
- data/docs/content/guides/context.md +0 -45
- data/docs/content/guides/expressions.md +0 -175
- data/docs/content/guides/features.md +0 -50
- data/docs/content/guides/formats.md +0 -37
- data/docs/content/guides/installation.md +0 -51
- data/docs/content/guides/random.md +0 -100
- data/docs/content/guides/results.md +0 -62
- data/docs/content/index.html +0 -44
- data/docs/content/introduction.md +0 -23
- data/docs/content/introduction/concepts.md +0 -82
- data/docs/content/introduction/contributing.md +0 -43
- data/docs/content/introduction/tutorial.md +0 -129
- data/docs/content/styleguide.html +0 -71
- data/docs/docs.scss +0 -94
- data/docs/index.html +0 -12
- data/docs/package-lock.json +0 -1536
- data/docs/package.json +0 -16
- data/examples/faker.yml +0 -42
- data/lib/calyx/production/expression.rb +0 -32
data/lib/calyx/rule.rb
CHANGED
@@ -2,20 +2,41 @@ module Calyx
|
|
2
2
|
# Represents a named rule connected to a tree of productions that can be
|
3
3
|
# evaluated and a trace which represents where the rule was declared.
|
4
4
|
class Rule
|
5
|
-
|
5
|
+
def self.build_ast(productions, registry)
|
6
|
+
if productions.first.is_a?(Hash)
|
7
|
+
# TODO: test that key is a string
|
8
|
+
|
9
|
+
if productions.first.first.last.is_a?(String)
|
10
|
+
# If value of the production is a strings then this is a
|
11
|
+
# paired mapping production.
|
12
|
+
Production::AffixTable.parse(productions.first, registry)
|
13
|
+
else
|
14
|
+
# Otherwise, we assume this is a weighted choice declaration and
|
15
|
+
# convert the hash to an array
|
16
|
+
Syntax::WeightedChoices.parse(productions.first.to_a, registry)
|
17
|
+
end
|
18
|
+
elsif productions.first.is_a?(Enumerable)
|
19
|
+
# TODO: this needs to change to support attributed/tagged grammars
|
20
|
+
Syntax::WeightedChoices.parse(productions, registry)
|
21
|
+
else
|
22
|
+
Syntax::Choices.parse(productions, registry)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
attr_reader :name, :tree, :trace
|
6
27
|
|
7
28
|
def initialize(name, productions, trace)
|
8
29
|
@name = name.to_sym
|
9
|
-
@
|
30
|
+
@tree = productions
|
10
31
|
@trace = trace
|
11
32
|
end
|
12
33
|
|
13
34
|
def size
|
14
|
-
|
35
|
+
tree.size
|
15
36
|
end
|
16
37
|
|
17
38
|
def evaluate(options)
|
18
|
-
|
39
|
+
tree.evaluate(options)
|
19
40
|
end
|
20
41
|
end
|
21
42
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Calyx
|
2
2
|
# A type of production rule representing a list of possible rules, one of
|
3
3
|
# which will chosen each time the grammar runs.
|
4
|
-
module
|
4
|
+
module Syntax
|
5
5
|
class Choices
|
6
6
|
# Parse a list of productions and return a choice node which is the head
|
7
7
|
# of a syntax tree of child nodes.
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Calyx
|
2
|
-
module
|
2
|
+
module Syntax
|
3
3
|
# A type of production rule representing a string combining both template
|
4
4
|
# substitutions and raw content.
|
5
5
|
class Concat
|
6
|
-
EXPRESSION = /(\{[A-Za-z0-9_
|
6
|
+
EXPRESSION = /(\{[A-Za-z0-9_@$<>\.]+\})/.freeze
|
7
|
+
DEREF_OP = /([<>\.])/.freeze
|
7
8
|
START_TOKEN = '{'.freeze
|
8
9
|
END_TOKEN = '}'.freeze
|
9
|
-
DEREF_TOKEN = '.'.freeze
|
10
10
|
|
11
11
|
# Parses an interpolated string into fragments combining terminal strings
|
12
12
|
# and non-terminal rules.
|
@@ -16,21 +16,14 @@ module Calyx
|
|
16
16
|
# @param [String] production
|
17
17
|
# @param [Calyx::Registry] registry
|
18
18
|
def self.parse(production, registry)
|
19
|
-
|
19
|
+
expressions = production.split(EXPRESSION).map do |atom|
|
20
20
|
if atom.is_a?(String)
|
21
21
|
if atom.chars.first == START_TOKEN && atom.chars.last == END_TOKEN
|
22
|
-
head, *tail = atom.slice(1, atom.length-2).split(
|
23
|
-
if
|
24
|
-
|
25
|
-
elsif head[0] == Unique::SIGIL
|
26
|
-
rule = Unique.new(head, registry)
|
22
|
+
head, *tail = atom.slice(1, atom.length-2).split(DEREF_OP)
|
23
|
+
if tail.any?
|
24
|
+
ExpressionChain.parse(head, tail, registry)
|
27
25
|
else
|
28
|
-
|
29
|
-
end
|
30
|
-
unless tail.empty?
|
31
|
-
Expression.new(rule, tail, registry)
|
32
|
-
else
|
33
|
-
rule
|
26
|
+
Expression.parse(head, registry)
|
34
27
|
end
|
35
28
|
else
|
36
29
|
Terminal.new(atom)
|
@@ -38,28 +31,31 @@ module Calyx
|
|
38
31
|
end
|
39
32
|
end
|
40
33
|
|
41
|
-
self.new(
|
34
|
+
self.new(expressions)
|
42
35
|
end
|
43
36
|
|
44
37
|
# Initialize the concat node with an expansion of terminal and
|
45
38
|
# non-terminal fragments.
|
46
39
|
#
|
47
40
|
# @param [Array] expansion
|
48
|
-
def initialize(
|
49
|
-
@
|
41
|
+
def initialize(expressions)
|
42
|
+
@expressions = expressions
|
50
43
|
end
|
51
44
|
|
52
|
-
# Evaluate all the child nodes of this node and concatenate
|
53
|
-
# into a single result.
|
45
|
+
# Evaluate all the child nodes of this node and concatenate each expansion
|
46
|
+
# together into a single result.
|
54
47
|
#
|
55
48
|
# @param [Calyx::Options] options
|
56
49
|
# @return [Array]
|
57
50
|
def evaluate(options)
|
58
|
-
|
51
|
+
expansion = @expressions.reduce([]) do |exp, atom|
|
59
52
|
exp << atom.evaluate(options)
|
60
53
|
end
|
61
54
|
|
62
|
-
[:
|
55
|
+
#[:expansion, expansion]
|
56
|
+
# TODO: fix this along with a git rename
|
57
|
+
# Commented out because of a lot of tests depending on :concat symbol
|
58
|
+
[:concat, expansion]
|
63
59
|
end
|
64
60
|
end
|
65
61
|
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
module Calyx
|
2
|
+
module Syntax
|
3
|
+
# A symbolic expression representing a single template substitution.
|
4
|
+
class Expression
|
5
|
+
def self.parse(symbol, registry)
|
6
|
+
if symbol[0] == Memo::SIGIL
|
7
|
+
Memo.new(symbol, registry)
|
8
|
+
elsif symbol[0] == Unique::SIGIL
|
9
|
+
Unique.new(symbol, registry)
|
10
|
+
else
|
11
|
+
NonTerminal.new(symbol, registry)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Modifier < Struct.new(:type, :name, :map_dir)
|
17
|
+
def self.filter(name)
|
18
|
+
new(:filter, name, nil)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.map_left(name)
|
22
|
+
new(:map, name, :left)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.map_right(name)
|
26
|
+
new(:map, name, :right)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Handles filter chains that symbolic expressions can pass through to
|
31
|
+
# generate a custom substitution.
|
32
|
+
class ExpressionChain
|
33
|
+
def self.parse(production, production_chain, registry)
|
34
|
+
modifier_chain = production_chain.each_slice(2).map do |op_token, target|
|
35
|
+
rule = target.to_sym
|
36
|
+
case op_token
|
37
|
+
when Token::EXPR_FILTER then Modifier.filter(rule)
|
38
|
+
when Token::EXPR_MAP_LEFT then Modifier.map_left(rule)
|
39
|
+
when Token::EXPR_MAP_RIGHT then Modifier.map_right(rule)
|
40
|
+
else
|
41
|
+
# Should not end up here because the regex excludes it but this
|
42
|
+
# could be a place to add a helpful parse error on any weird
|
43
|
+
# chars used by the expression—current behaviour is to pass
|
44
|
+
# the broken expression through to the result as part of the
|
45
|
+
# text, as if that is what the author meant.
|
46
|
+
raise("unreachable")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
expression = Expression.parse(production, registry)
|
51
|
+
|
52
|
+
self.new(expression, modifier_chain, registry)
|
53
|
+
end
|
54
|
+
|
55
|
+
# @param [#evaluate] production
|
56
|
+
# @param [Array] modifiers
|
57
|
+
# @param [Calyx::Registry] registry
|
58
|
+
def initialize(production, modifiers, registry)
|
59
|
+
@production = production
|
60
|
+
@modifiers = modifiers
|
61
|
+
@registry = registry
|
62
|
+
end
|
63
|
+
|
64
|
+
# Evaluate the expression by expanding the non-terminal to produce a
|
65
|
+
# terminal string, then passing it through the given modifier chain and
|
66
|
+
# returning the transformed result.
|
67
|
+
#
|
68
|
+
# @param [Calyx::Options] options
|
69
|
+
# @return [Array]
|
70
|
+
def evaluate(options)
|
71
|
+
expanded = @production.evaluate(options).flatten.reject { |o| o.is_a?(Symbol) }.join
|
72
|
+
chain = []
|
73
|
+
|
74
|
+
expression = @modifiers.reduce(expanded) do |value, modifier|
|
75
|
+
case modifier.type
|
76
|
+
when :filter
|
77
|
+
@registry.expand_filter(modifier.name, value)
|
78
|
+
when :map
|
79
|
+
@registry.expand_map(modifier.name, value, modifier.map_dir)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
[:expression, expression]
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Calyx
|
2
|
+
module Syntax
|
3
|
+
# A type of production rule representing a bidirectional dictionary of
|
4
|
+
# mapping pairs that can be used as a substitution table in template
|
5
|
+
# expressions.
|
6
|
+
class PairedMapping
|
7
|
+
def self.parse(productions, registry)
|
8
|
+
# TODO: handle wildcard expressions
|
9
|
+
self.new(productions)
|
10
|
+
end
|
11
|
+
|
12
|
+
# %es
|
13
|
+
# prefix: nil, suffix: 'es'
|
14
|
+
# match: 'buses' -> ends_with(suffix)
|
15
|
+
|
16
|
+
# %y
|
17
|
+
# prefix: nil, suffix: 'ies'
|
18
|
+
|
19
|
+
def initialize(mapping)
|
20
|
+
@lhs_index = PrefixTree.new
|
21
|
+
@rhs_index = PrefixTree.new
|
22
|
+
|
23
|
+
@lhs_list = mapping.keys
|
24
|
+
@rhs_list = mapping.values
|
25
|
+
|
26
|
+
@lhs_index.add_all(@lhs_list)
|
27
|
+
@rhs_index.add_all(@rhs_list)
|
28
|
+
end
|
29
|
+
|
30
|
+
def value_for(key)
|
31
|
+
match = @lhs_index.lookup(key)
|
32
|
+
result = @rhs_list[match.index]
|
33
|
+
|
34
|
+
if match.captured
|
35
|
+
result.sub("%", match.captured)
|
36
|
+
else
|
37
|
+
result
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def key_for(value)
|
42
|
+
match = @rhs_index.lookup(value)
|
43
|
+
result = @lhs_list[match.index]
|
44
|
+
|
45
|
+
if match.captured
|
46
|
+
result.sub("%", match.captured)
|
47
|
+
else
|
48
|
+
result
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Calyx
|
2
|
-
module
|
2
|
+
module Syntax
|
3
3
|
# A type of production rule representing a unique substitution which only
|
4
4
|
# returns values that have not previously been selected. The probability
|
5
5
|
# that a given rule will be selected increases as more selections are made
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Calyx
|
2
|
-
module
|
2
|
+
module Syntax
|
3
3
|
# A type of production rule representing a map of possible rules with
|
4
4
|
# associated weights that define the expected probability of a rule
|
5
5
|
# being chosen.
|
@@ -12,7 +12,7 @@ module Calyx
|
|
12
12
|
#
|
13
13
|
# @param [Array<Array>, Hash<#to_s, Float>] productions
|
14
14
|
# @param [Calyx::Registry] registry
|
15
|
-
# @return [Calyx::
|
15
|
+
# @return [Calyx::Syntax::WeightedChoices]
|
16
16
|
def self.parse(productions, registry)
|
17
17
|
if productions.first.last.is_a?(Range)
|
18
18
|
range_max = productions.max { |a,b| a.last.max <=> b.last.max }.last.max
|
@@ -63,6 +63,13 @@ module Calyx
|
|
63
63
|
@collection = collection
|
64
64
|
end
|
65
65
|
|
66
|
+
# The number of possible choices available for this rule.
|
67
|
+
#
|
68
|
+
# @return [Integer]
|
69
|
+
def size
|
70
|
+
@collection.size
|
71
|
+
end
|
72
|
+
|
66
73
|
# Evaluate the choice by randomly picking one of its possible options,
|
67
74
|
# balanced according to the given weights.
|
68
75
|
#
|
data/lib/calyx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calyx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rickerby
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,8 +60,8 @@ executables: []
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
+
- ".github/workflows/ruby.yml"
|
63
64
|
- ".gitignore"
|
64
|
-
- ".travis.yml"
|
65
65
|
- CODE_OF_CONDUCT.md
|
66
66
|
- CONTRIBUTING.md
|
67
67
|
- Gemfile
|
@@ -69,98 +69,40 @@ files:
|
|
69
69
|
- README.md
|
70
70
|
- SYNTAX.md
|
71
71
|
- calyx.gemspec
|
72
|
-
- docs/404.html
|
73
|
-
- docs/CNAME
|
74
|
-
- docs/_config.yml
|
75
|
-
- docs/_data/breadcrumbs.yml
|
76
|
-
- docs/_data/docs.yml
|
77
|
-
- docs/_data/examples.yml
|
78
|
-
- docs/_includes/breadcrumbs.html
|
79
|
-
- docs/_includes/contents.html
|
80
|
-
- docs/_includes/icon-github.html
|
81
|
-
- docs/_includes/icon-rubygems.html
|
82
|
-
- docs/_includes/navbar.html
|
83
|
-
- docs/_includes/pagebar.html
|
84
|
-
- docs/_layouts/default.html
|
85
|
-
- docs/_layouts/docs.html
|
86
|
-
- docs/_layouts/home.html
|
87
|
-
- docs/_layouts/page.html
|
88
|
-
- docs/_posts/2017-09-14-welcome-to-jekyll.markdown
|
89
|
-
- docs/_posts/2017-09-21-0.17.0-released.md
|
90
|
-
- docs/_styles/card.scss
|
91
|
-
- docs/_styles/colors.scss
|
92
|
-
- docs/_styles/content.scss
|
93
|
-
- docs/_styles/cta.scss
|
94
|
-
- docs/_styles/grid.scss
|
95
|
-
- docs/_styles/media.scss
|
96
|
-
- docs/_styles/menu.scss
|
97
|
-
- docs/_styles/modifiers.scss
|
98
|
-
- docs/_styles/navbar.scss
|
99
|
-
- docs/_styles/pagebar.scss
|
100
|
-
- docs/_styles/reset.scss
|
101
|
-
- docs/_styles/scale.scss
|
102
|
-
- docs/_styles/spread.scss
|
103
|
-
- docs/_styles/styleguide.scss
|
104
|
-
- docs/_styles/syntax.scss
|
105
|
-
- docs/_styles/typography.scss
|
106
|
-
- docs/_styles/yard.scss
|
107
|
-
- docs/api.html
|
108
|
-
- docs/assets/calyx-docs.css
|
109
|
-
- docs/assets/calyx-flower-outline.svg
|
110
|
-
- docs/assets/calyx-flower-reverse.svg
|
111
|
-
- docs/assets/calyx-flower.svg
|
112
|
-
- docs/assets/logo-small.png
|
113
|
-
- docs/assets/logos/calyx-flower-1.svg
|
114
|
-
- docs/assets/logos/calyx-flower-2.svg
|
115
|
-
- docs/content/documentation.html
|
116
|
-
- docs/content/examples.html
|
117
|
-
- docs/content/examples/any-gradient.md
|
118
|
-
- docs/content/examples/faker.md
|
119
|
-
- docs/content/examples/tiny-woodland-bot.md
|
120
|
-
- docs/content/guides/context.md
|
121
|
-
- docs/content/guides/expressions.md
|
122
|
-
- docs/content/guides/features.md
|
123
|
-
- docs/content/guides/formats.md
|
124
|
-
- docs/content/guides/installation.md
|
125
|
-
- docs/content/guides/random.md
|
126
|
-
- docs/content/guides/results.md
|
127
|
-
- docs/content/index.html
|
128
|
-
- docs/content/introduction.md
|
129
|
-
- docs/content/introduction/concepts.md
|
130
|
-
- docs/content/introduction/contributing.md
|
131
|
-
- docs/content/introduction/tutorial.md
|
132
|
-
- docs/content/styleguide.html
|
133
|
-
- docs/docs.scss
|
134
|
-
- docs/index.html
|
135
|
-
- docs/package-lock.json
|
136
|
-
- docs/package.json
|
137
72
|
- examples/any_gradient.rb
|
73
|
+
- examples/faker.json
|
138
74
|
- examples/faker.rb
|
139
|
-
- examples/faker.yml
|
140
75
|
- examples/tiny_woodland_bot.rb
|
141
76
|
- lib/calyx.rb
|
142
77
|
- lib/calyx/errors.rb
|
143
78
|
- lib/calyx/format.rb
|
144
79
|
- lib/calyx/grammar.rb
|
80
|
+
- lib/calyx/mapping.rb
|
145
81
|
- lib/calyx/modifiers.rb
|
146
82
|
- lib/calyx/options.rb
|
147
|
-
- lib/calyx/
|
148
|
-
- lib/calyx/production/
|
149
|
-
- lib/calyx/production/
|
150
|
-
- lib/calyx/production/
|
151
|
-
- lib/calyx/production/non_terminal.rb
|
152
|
-
- lib/calyx/production/terminal.rb
|
153
|
-
- lib/calyx/production/unique.rb
|
154
|
-
- lib/calyx/production/weighted_choices.rb
|
83
|
+
- lib/calyx/prefix_tree.rb
|
84
|
+
- lib/calyx/production/affix_table.rb
|
85
|
+
- lib/calyx/production/uniform_branch.rb
|
86
|
+
- lib/calyx/production/weighted_branch.rb
|
155
87
|
- lib/calyx/registry.rb
|
156
88
|
- lib/calyx/result.rb
|
157
89
|
- lib/calyx/rule.rb
|
90
|
+
- lib/calyx/syntax/choices.rb
|
91
|
+
- lib/calyx/syntax/concat.rb
|
92
|
+
- lib/calyx/syntax/expression.rb
|
93
|
+
- lib/calyx/syntax/memo.rb
|
94
|
+
- lib/calyx/syntax/non_terminal.rb
|
95
|
+
- lib/calyx/syntax/paired_mapping.rb
|
96
|
+
- lib/calyx/syntax/terminal.rb
|
97
|
+
- lib/calyx/syntax/token.rb
|
98
|
+
- lib/calyx/syntax/unique.rb
|
99
|
+
- lib/calyx/syntax/weighted_choices.rb
|
158
100
|
- lib/calyx/version.rb
|
159
101
|
homepage: https://github.com/maetl/calyx
|
160
102
|
licenses:
|
161
103
|
- MIT
|
162
104
|
metadata: {}
|
163
|
-
post_install_message:
|
105
|
+
post_install_message:
|
164
106
|
rdoc_options: []
|
165
107
|
require_paths:
|
166
108
|
- lib
|
@@ -175,9 +117,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
117
|
- !ruby/object:Gem::Version
|
176
118
|
version: '0'
|
177
119
|
requirements: []
|
178
|
-
|
179
|
-
|
180
|
-
signing_key:
|
120
|
+
rubygems_version: 3.1.2
|
121
|
+
signing_key:
|
181
122
|
specification_version: 4
|
182
123
|
summary: Generate text with declarative recursive grammars
|
183
124
|
test_files: []
|