sportdb-parser 0.5.1 → 0.5.3
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/CHANGELOG.md +1 -1
- data/lib/sportdb/parser/lang.rb +11 -7
- data/lib/sportdb/parser/outline_reader.rb +58 -0
- data/lib/sportdb/parser/parser.rb +387 -273
- data/lib/sportdb/parser/token-status.rb +15 -8
- data/lib/sportdb/parser/version.rb +1 -1
- data/lib/sportdb/parser.rb +20 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4ad809654d751437839e7f7bbda6502fb2c4b517c279988c7a3756059eaa9d8
|
4
|
+
data.tar.gz: 6dbacfa44774d32bfaccdb209a195f2f6c6c9ded43280023ffafbe1a3288d310
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52b60ab7ef460d46007bd135fc0a00d09514b72335941c2d46f06793abc6631f7e2dce2fafefbf83360c672a05d212cf88f56ed3a6b78e803d5e5d76c0dcb38b
|
7
|
+
data.tar.gz: 4e861cefafce9bca2fe9135ae7fdf35a2cdd0d2080fa3f4f2fb900fa0f075752da8647dcb2c6c9e16e99210c4198a63e7202ae3e32cd1b0f049126aac7f3d412
|
data/CHANGELOG.md
CHANGED
data/lib/sportdb/parser/lang.rb
CHANGED
@@ -4,7 +4,12 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
module SportDb
|
7
|
-
|
7
|
+
|
8
|
+
## use module or class for Lang namespace??
|
9
|
+
## start with module for now
|
10
|
+
|
11
|
+
|
12
|
+
module Lang
|
8
13
|
|
9
14
|
## Group A-Z
|
10
15
|
## Group 1-99
|
@@ -17,7 +22,7 @@ GROUP_RE = %r{^
|
|
17
22
|
Group [ ]
|
18
23
|
(?<key>[a-z0-9]+)
|
19
24
|
$}ix
|
20
|
-
def is_group?( text )
|
25
|
+
def self.is_group?( text )
|
21
26
|
## use regex for match
|
22
27
|
GROUP_RE.match?( text )
|
23
28
|
end
|
@@ -191,9 +196,8 @@ def self.more_round_names
|
|
191
196
|
end
|
192
197
|
|
193
198
|
|
194
|
-
def is_round?( text )
|
195
|
-
ROUND_RE.match?( text ) ||
|
196
|
-
self.class.more_round_names.include?( text )
|
199
|
+
def self.is_round?( text )
|
200
|
+
ROUND_RE.match?( text ) || more_round_names.include?( text )
|
197
201
|
end
|
198
202
|
|
199
203
|
##
|
@@ -208,10 +212,10 @@ LEG_RE = %r{^
|
|
208
212
|
$}ix
|
209
213
|
|
210
214
|
### Pair matches/games if marked with leg1 n leg2
|
211
|
-
def is_leg?( text )
|
215
|
+
def self.is_leg?( text )
|
212
216
|
LEG_RE.match?( text )
|
213
217
|
end
|
214
218
|
|
215
219
|
|
216
|
-
end #
|
220
|
+
end # module Lang
|
217
221
|
end # module SportDb
|
@@ -2,6 +2,64 @@
|
|
2
2
|
|
3
3
|
module SportDb
|
4
4
|
|
5
|
+
###
|
6
|
+
# add a simple Outline convenience class
|
7
|
+
# for processing OUtlines with OUtlineReader
|
8
|
+
|
9
|
+
class QuickMatchOutline
|
10
|
+
def self.read( path )
|
11
|
+
nodes = OutlineReader.read( path )
|
12
|
+
new( nodes )
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize( nodes )
|
16
|
+
@nodes = nodes
|
17
|
+
end
|
18
|
+
|
19
|
+
def each_para( &blk )
|
20
|
+
## note: every (new) read call - resets errors list to empty
|
21
|
+
### @errors = []
|
22
|
+
|
23
|
+
## process nodes
|
24
|
+
h1 = nil
|
25
|
+
h2 = nil
|
26
|
+
orphans = 0 ## track paragraphs's with no heading
|
27
|
+
|
28
|
+
@nodes.each do |node|
|
29
|
+
type = node[0]
|
30
|
+
|
31
|
+
if type == :h1
|
32
|
+
h1 = node[1] ## get heading text
|
33
|
+
puts " = Heading 1 >#{node[1]}<"
|
34
|
+
elsif type == :h2
|
35
|
+
if h1.nil?
|
36
|
+
puts "!! WARN - no heading for subheading; skipping processing"
|
37
|
+
next
|
38
|
+
end
|
39
|
+
h2 = node[1] ## get heading text
|
40
|
+
puts " == Heading 2 >#{node[1]}<"
|
41
|
+
elsif type == :p
|
42
|
+
if h1.nil?
|
43
|
+
orphans += 1 ## only warn once
|
44
|
+
puts "!! WARN - no heading for #{orphans} text paragraph(s); skipping parse"
|
45
|
+
next
|
46
|
+
end
|
47
|
+
|
48
|
+
lines = node[1]
|
49
|
+
blk.call( lines )
|
50
|
+
else
|
51
|
+
pp node
|
52
|
+
raise ArgumentError, "unsupported (node) type >#{type}<"
|
53
|
+
end
|
54
|
+
end # each node
|
55
|
+
end # each_para
|
56
|
+
alias_method :each_paragraph, :each_para
|
57
|
+
alias_method :each_p, :each_para
|
58
|
+
end # class QuickMatchOutline
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
5
63
|
class OutlineReader
|
6
64
|
|
7
65
|
def self.debug=(value) @@debug = value; end
|
@@ -9,178 +9,204 @@ class RaccMatchParser < Racc::Parser
|
|
9
9
|
##### State transition tables begin ###
|
10
10
|
|
11
11
|
racc_action_table = [
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
103, 54, 60, 120, 28, 58, 35, 92, 23, 128,
|
13
|
+
80, 60, 81, 60, 43, 121, 41, 39, 38, 52,
|
14
|
+
55, 61, 62, 65, 65, 31, 55, 12, 127, 30,
|
15
|
+
61, 28, 61, 62, 40, 16, 12, 50, 30, 13,
|
16
|
+
28, 25, 14, 15, 16, 21, 23, 54, 13, 37,
|
17
|
+
25, 14, 15, 43, 21, 23, 72, 74, 75, 76,
|
18
|
+
36, 44, 47, 46, 68, 52, 55, 85, 86, 105,
|
19
|
+
106, 118, 119, 129, 130, 137, 130, 56, 66, 70,
|
20
|
+
71, 83, 87, 88, 65, 89, 91, 94, 96, 99,
|
21
|
+
40, 100, 101, 43, 108, 43, 110, 35, 112, 113,
|
22
|
+
80, 65, 122, 123, 124, 99, 126, 132, 65, 43,
|
23
|
+
43, 35, 135, 65, 138, 99, 140, 141 ]
|
22
24
|
|
23
25
|
racc_action_check = [
|
24
|
-
|
25
|
-
|
26
|
-
19,
|
27
|
-
|
28
|
-
0,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
63, 19, 25, 82, 16, 21, 12, 52, 21, 95,
|
27
|
+
35, 99, 35, 50, 16, 82, 16, 15, 14, 19,
|
28
|
+
19, 25, 25, 63, 25, 1, 52, 1, 95, 1,
|
29
|
+
99, 1, 50, 50, 15, 1, 0, 18, 0, 1,
|
30
|
+
0, 1, 1, 1, 0, 1, 1, 48, 0, 13,
|
31
|
+
0, 0, 0, 27, 0, 0, 33, 33, 33, 33,
|
32
|
+
13, 17, 17, 17, 27, 48, 48, 38, 38, 65,
|
33
|
+
65, 81, 81, 97, 97, 125, 125, 20, 26, 28,
|
34
|
+
31, 36, 41, 42, 43, 45, 49, 53, 55, 56,
|
35
|
+
58, 59, 62, 67, 68, 70, 72, 73, 75, 76,
|
36
|
+
78, 80, 84, 87, 88, 91, 93, 100, 103, 107,
|
37
|
+
109, 115, 116, 117, 128, 130, 131, 134 ]
|
34
38
|
|
35
39
|
racc_action_pointer = [
|
36
|
-
|
37
|
-
nil, nil,
|
38
|
-
-
|
39
|
-
nil, 53, nil,
|
40
|
-
|
41
|
-
nil,
|
42
|
-
|
43
|
-
79, nil,
|
44
|
-
|
45
|
-
nil,
|
46
|
-
|
47
|
-
nil, nil, nil,
|
40
|
+
34, 25, nil, nil, nil, nil, nil, nil, nil, nil,
|
41
|
+
nil, nil, -1, 45, 3, 13, -2, 57, 21, -3,
|
42
|
+
72, -13, nil, nil, nil, -4, 74, 37, 52, nil,
|
43
|
+
nil, 80, nil, 53, nil, 2, 65, nil, 49, nil,
|
44
|
+
nil, 71, 72, 56, nil, 68, nil, nil, 43, 81,
|
45
|
+
7, nil, 3, 83, nil, 72, 73, nil, 69, 75,
|
46
|
+
nil, nil, 76, -5, nil, 40, nil, 77, 90, nil,
|
47
|
+
79, nil, 92, 90, nil, 94, 95, nil, 92, nil,
|
48
|
+
73, 59, -1, nil, 98, nil, nil, 99, 100, nil,
|
49
|
+
nil, 89, nil, 102, nil, 4, nil, 69, nil, 5,
|
50
|
+
81, nil, nil, 80, nil, nil, nil, 93, nil, 94,
|
51
|
+
nil, nil, nil, nil, nil, 104, 101, 85, nil, nil,
|
52
|
+
nil, nil, nil, nil, nil, 71, nil, nil, 98, nil,
|
53
|
+
99, 100, nil, nil, 108, nil, nil, nil, nil, nil,
|
54
|
+
nil, nil ]
|
48
55
|
|
49
56
|
racc_action_default = [
|
50
|
-
-
|
51
|
-
-10, -11, -
|
52
|
-
-
|
53
|
-
-2, -
|
54
|
-
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
57
|
+
-90, -90, -1, -3, -4, -5, -6, -7, -8, -9,
|
58
|
+
-10, -11, -90, -90, -41, -54, -90, -90, -90, -90,
|
59
|
+
-66, -51, -53, -56, -65, -90, -90, -74, -90, -79,
|
60
|
+
-89, -90, -2, -90, -13, -20, -90, -39, -90, -37,
|
61
|
+
-55, -90, -90, -90, -40, -90, -43, -44, -90, -66,
|
62
|
+
-90, -46, -90, -90, -60, -90, -90, -52, -54, -90,
|
63
|
+
-68, -69, -90, -81, -82, -85, -73, -90, -77, -80,
|
64
|
+
-90, 142, -90, -90, -15, -16, -18, -21, -22, -24,
|
65
|
+
-90, -90, -90, -32, -90, -35, -36, -90, -90, -42,
|
66
|
+
-45, -90, -57, -90, -59, -61, -63, -90, -49, -90,
|
67
|
+
-67, -70, -83, -90, -86, -87, -88, -76, -78, -75,
|
68
|
+
-12, -14, -17, -19, -23, -90, -90, -27, -29, -30,
|
69
|
+
-31, -33, -34, -38, -72, -90, -58, -62, -90, -48,
|
70
|
+
-90, -90, -71, -84, -90, -26, -28, -47, -64, -50,
|
71
|
+
-67, -25 ]
|
62
72
|
|
63
73
|
racc_goto_table = [
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
nil,
|
68
|
-
|
69
|
-
nil, nil, nil, nil, nil, nil,
|
74
|
+
49, 34, 69, 102, 79, 97, 51, 107, 2, 32,
|
75
|
+
109, 1, 33, 73, 77, 78, 116, 117, 82, 84,
|
76
|
+
115, 45, 48, 57, 93, 95, 131, 42, 67, 104,
|
77
|
+
nil, nil, nil, nil, nil, 90, nil, nil, 98, nil,
|
78
|
+
125, nil, nil, 133, nil, nil, nil, 114, nil, nil,
|
79
|
+
nil, nil, nil, nil, nil, nil, nil, 136, nil, nil,
|
80
|
+
nil, nil, 111, nil, nil, nil, nil, nil, nil, nil,
|
81
|
+
nil, nil, nil, 98, nil, nil, nil, nil, nil, nil,
|
82
|
+
nil, nil, 69, nil, 69, nil, nil, nil, nil, nil,
|
70
83
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
71
|
-
nil, nil,
|
72
|
-
nil, nil,
|
73
|
-
nil, 115 ]
|
84
|
+
nil, nil, nil, nil, 134, nil, nil, nil, nil, nil,
|
85
|
+
nil, nil, 139 ]
|
74
86
|
|
75
87
|
racc_goto_check = [
|
76
|
-
13,
|
77
|
-
12, 14, 15, 16, 19, 20, 21, 22,
|
78
|
-
18,
|
79
|
-
nil,
|
80
|
-
|
81
|
-
nil, nil, nil, nil, nil, nil,
|
82
|
-
nil, nil,
|
83
|
-
nil, nil,
|
88
|
+
28, 13, 38, 18, 17, 29, 27, 36, 2, 2,
|
89
|
+
36, 1, 12, 14, 15, 16, 19, 20, 21, 22,
|
90
|
+
18, 24, 26, 30, 31, 32, 34, 35, 37, 40,
|
91
|
+
nil, nil, nil, nil, nil, 27, nil, nil, 28, nil,
|
92
|
+
29, nil, nil, 18, nil, nil, nil, 17, nil, nil,
|
93
|
+
nil, nil, nil, nil, nil, nil, nil, 18, nil, nil,
|
94
|
+
nil, nil, 13, nil, nil, nil, nil, nil, nil, nil,
|
95
|
+
nil, nil, nil, 28, nil, nil, nil, nil, nil, nil,
|
96
|
+
nil, nil, 38, nil, 38, nil, nil, nil, nil, nil,
|
84
97
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
85
|
-
nil, 13
|
98
|
+
nil, nil, nil, nil, 13, nil, nil, nil, nil, nil,
|
99
|
+
nil, nil, 28 ]
|
86
100
|
|
87
101
|
racc_goto_pointer = [
|
88
|
-
nil,
|
89
|
-
nil, nil,
|
90
|
-
-
|
91
|
-
-
|
102
|
+
nil, 11, 8, nil, nil, nil, nil, nil, nil, nil,
|
103
|
+
nil, nil, 0, -11, -20, -21, -20, -31, -60, -65,
|
104
|
+
-64, -18, -19, nil, 4, nil, 4, -13, -18, -51,
|
105
|
+
2, -28, -30, nil, -73, 11, -60, 1, -25, nil,
|
106
|
+
-36 ]
|
92
107
|
|
93
108
|
racc_goto_default = [
|
94
109
|
nil, nil, nil, 3, 4, 5, 6, 7, 8, 9,
|
95
|
-
10, 11, nil, nil, nil, nil, nil, nil,
|
96
|
-
nil, nil, nil, 17, nil, 18, 19, nil,
|
97
|
-
nil,
|
110
|
+
10, 11, nil, nil, nil, nil, nil, nil, 64, nil,
|
111
|
+
nil, nil, nil, 17, nil, 18, 19, nil, 20, nil,
|
112
|
+
22, 53, nil, 24, 59, 26, 27, nil, 29, 63,
|
113
|
+
nil ]
|
98
114
|
|
99
115
|
racc_reduce_table = [
|
100
116
|
0, 0, :racc_error,
|
101
|
-
1,
|
102
|
-
2,
|
103
|
-
1,
|
104
|
-
1,
|
105
|
-
1,
|
106
|
-
1,
|
107
|
-
1,
|
108
|
-
1,
|
109
|
-
1,
|
110
|
-
1,
|
111
|
-
1,
|
112
|
-
4,
|
113
|
-
1,
|
114
|
-
3,
|
115
|
-
2,
|
116
|
-
1,
|
117
|
-
2,
|
118
|
-
1,
|
119
|
-
|
120
|
-
1,
|
121
|
-
2,
|
122
|
-
1,
|
123
|
-
2,
|
124
|
-
1,
|
125
|
-
4,
|
126
|
-
3,
|
127
|
-
1,
|
128
|
-
2,
|
129
|
-
1,
|
130
|
-
1,
|
131
|
-
4,
|
132
|
-
1,
|
133
|
-
2,
|
134
|
-
4,
|
135
|
-
1,
|
136
|
-
1,
|
137
|
-
2,
|
138
|
-
4,
|
139
|
-
2,
|
140
|
-
2,
|
141
|
-
1,
|
142
|
-
3,
|
143
|
-
1,
|
144
|
-
1,
|
145
|
-
3,
|
146
|
-
2,
|
147
|
-
|
148
|
-
|
149
|
-
1,
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
1,
|
155
|
-
2,
|
156
|
-
1,
|
157
|
-
|
158
|
-
3,
|
159
|
-
|
160
|
-
1,
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
1,
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
2,
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
1,
|
178
|
-
|
179
|
-
1,
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
117
|
+
1, 32, :_reduce_none,
|
118
|
+
2, 32, :_reduce_none,
|
119
|
+
1, 33, :_reduce_none,
|
120
|
+
1, 33, :_reduce_none,
|
121
|
+
1, 33, :_reduce_none,
|
122
|
+
1, 33, :_reduce_none,
|
123
|
+
1, 33, :_reduce_none,
|
124
|
+
1, 33, :_reduce_none,
|
125
|
+
1, 33, :_reduce_none,
|
126
|
+
1, 33, :_reduce_none,
|
127
|
+
1, 33, :_reduce_none,
|
128
|
+
4, 42, :_reduce_12,
|
129
|
+
1, 43, :_reduce_13,
|
130
|
+
3, 43, :_reduce_14,
|
131
|
+
2, 43, :_reduce_15,
|
132
|
+
1, 45, :_reduce_none,
|
133
|
+
2, 45, :_reduce_17,
|
134
|
+
1, 45, :_reduce_none,
|
135
|
+
2, 45, :_reduce_19,
|
136
|
+
1, 44, :_reduce_20,
|
137
|
+
2, 44, :_reduce_21,
|
138
|
+
1, 46, :_reduce_22,
|
139
|
+
2, 46, :_reduce_23,
|
140
|
+
1, 46, :_reduce_24,
|
141
|
+
4, 48, :_reduce_25,
|
142
|
+
3, 47, :_reduce_26,
|
143
|
+
1, 50, :_reduce_27,
|
144
|
+
2, 50, :_reduce_28,
|
145
|
+
1, 51, :_reduce_none,
|
146
|
+
1, 51, :_reduce_none,
|
147
|
+
4, 37, :_reduce_31,
|
148
|
+
1, 52, :_reduce_32,
|
149
|
+
2, 52, :_reduce_33,
|
150
|
+
4, 38, :_reduce_34,
|
151
|
+
1, 53, :_reduce_35,
|
152
|
+
1, 53, :_reduce_36,
|
153
|
+
2, 34, :_reduce_37,
|
154
|
+
4, 34, :_reduce_38,
|
155
|
+
2, 35, :_reduce_39,
|
156
|
+
2, 36, :_reduce_40,
|
157
|
+
1, 54, :_reduce_41,
|
158
|
+
3, 54, :_reduce_42,
|
159
|
+
1, 55, :_reduce_none,
|
160
|
+
1, 55, :_reduce_none,
|
161
|
+
3, 39, :_reduce_45,
|
162
|
+
2, 39, :_reduce_46,
|
163
|
+
5, 39, :_reduce_47,
|
164
|
+
4, 39, :_reduce_48,
|
165
|
+
1, 60, :_reduce_49,
|
166
|
+
3, 60, :_reduce_50,
|
167
|
+
1, 56, :_reduce_51,
|
168
|
+
2, 56, :_reduce_52,
|
169
|
+
1, 56, :_reduce_none,
|
170
|
+
1, 61, :_reduce_54,
|
171
|
+
2, 61, :_reduce_55,
|
172
|
+
1, 61, :_reduce_56,
|
173
|
+
2, 58, :_reduce_57,
|
174
|
+
3, 58, :_reduce_58,
|
175
|
+
2, 58, :_reduce_59,
|
176
|
+
1, 58, :_reduce_60,
|
177
|
+
2, 62, :_reduce_61,
|
178
|
+
3, 62, :_reduce_62,
|
179
|
+
1, 63, :_reduce_63,
|
180
|
+
3, 63, :_reduce_64,
|
181
|
+
1, 57, :_reduce_none,
|
182
|
+
1, 57, :_reduce_none,
|
183
|
+
3, 59, :_reduce_67,
|
184
|
+
1, 65, :_reduce_none,
|
185
|
+
1, 65, :_reduce_none,
|
186
|
+
3, 64, :_reduce_70,
|
187
|
+
4, 64, :_reduce_71,
|
188
|
+
4, 40, :_reduce_72,
|
189
|
+
2, 40, :_reduce_73,
|
190
|
+
1, 66, :_reduce_74,
|
191
|
+
3, 66, :_reduce_75,
|
192
|
+
3, 66, :_reduce_76,
|
193
|
+
1, 68, :_reduce_none,
|
194
|
+
2, 68, :_reduce_none,
|
195
|
+
1, 67, :_reduce_79,
|
196
|
+
2, 67, :_reduce_80,
|
197
|
+
2, 69, :_reduce_81,
|
198
|
+
1, 70, :_reduce_82,
|
199
|
+
2, 70, :_reduce_83,
|
200
|
+
3, 70, :_reduce_84,
|
201
|
+
1, 49, :_reduce_85,
|
202
|
+
2, 49, :_reduce_86,
|
203
|
+
1, 71, :_reduce_87,
|
204
|
+
1, 71, :_reduce_88,
|
205
|
+
1, 41, :_reduce_89 ]
|
206
|
+
|
207
|
+
racc_reduce_n = 90
|
208
|
+
|
209
|
+
racc_shift_n = 142
|
184
210
|
|
185
211
|
racc_token_table = {
|
186
212
|
false => 0,
|
@@ -190,30 +216,32 @@ racc_token_table = {
|
|
190
216
|
:NEWLINE => 4,
|
191
217
|
"," => 5,
|
192
218
|
"-" => 6,
|
193
|
-
|
194
|
-
|
195
|
-
"
|
196
|
-
"
|
197
|
-
"
|
198
|
-
|
199
|
-
:
|
200
|
-
:
|
201
|
-
|
202
|
-
|
203
|
-
:
|
204
|
-
:
|
205
|
-
:
|
206
|
-
:
|
207
|
-
:
|
208
|
-
:
|
219
|
+
:PROP_NAME => 7,
|
220
|
+
"(" => 8,
|
221
|
+
")" => 9,
|
222
|
+
"[" => 10,
|
223
|
+
"]" => 11,
|
224
|
+
:YELLOW_CARD => 12,
|
225
|
+
:RED_CARD => 13,
|
226
|
+
:GROUP => 14,
|
227
|
+
"|" => 15,
|
228
|
+
:TEXT => 16,
|
229
|
+
:ROUND => 17,
|
230
|
+
:DATE => 18,
|
231
|
+
:DURATION => 19,
|
232
|
+
:ORD => 20,
|
233
|
+
:TIME => 21,
|
234
|
+
:STATUS => 22,
|
209
235
|
"@" => 23,
|
210
|
-
:
|
236
|
+
:TIMEZONE => 24,
|
211
237
|
:VS => 25,
|
212
|
-
:
|
213
|
-
|
214
|
-
:
|
238
|
+
:SCORE => 26,
|
239
|
+
";" => 27,
|
240
|
+
:MINUTE => 28,
|
241
|
+
:OG => 29,
|
242
|
+
:PEN => 30 }
|
215
243
|
|
216
|
-
racc_nt_base =
|
244
|
+
racc_nt_base = 31
|
217
245
|
|
218
246
|
racc_use_result_var = true
|
219
247
|
|
@@ -242,7 +270,6 @@ Racc_token_to_s_table = [
|
|
242
270
|
"NEWLINE",
|
243
271
|
"\",\"",
|
244
272
|
"\"-\"",
|
245
|
-
"\";\"",
|
246
273
|
"PROP_NAME",
|
247
274
|
"\"(\"",
|
248
275
|
"\")\"",
|
@@ -258,9 +285,12 @@ Racc_token_to_s_table = [
|
|
258
285
|
"DURATION",
|
259
286
|
"ORD",
|
260
287
|
"TIME",
|
288
|
+
"STATUS",
|
261
289
|
"\"@\"",
|
262
|
-
"
|
290
|
+
"TIMEZONE",
|
263
291
|
"VS",
|
292
|
+
"SCORE",
|
293
|
+
"\";\"",
|
264
294
|
"MINUTE",
|
265
295
|
"OG",
|
266
296
|
"PEN",
|
@@ -292,10 +322,13 @@ Racc_token_to_s_table = [
|
|
292
322
|
"match_opts",
|
293
323
|
"match",
|
294
324
|
"more_match_opts",
|
325
|
+
"match_fixture",
|
326
|
+
"more_match_fixtures",
|
295
327
|
"date_opts",
|
296
328
|
"geo_opts",
|
297
329
|
"geo_values",
|
298
|
-
"
|
330
|
+
"match_result",
|
331
|
+
"match_sep",
|
299
332
|
"goal_lines_body",
|
300
333
|
"goals",
|
301
334
|
"goal_sep",
|
@@ -380,9 +413,14 @@ module_eval(<<'.,.,', 'parser.y', 52)
|
|
380
413
|
|
381
414
|
# reduce 18 omitted
|
382
415
|
|
383
|
-
|
416
|
+
module_eval(<<'.,.,', 'parser.y', 54)
|
417
|
+
def _reduce_19(val, _values, result)
|
418
|
+
result = val[0]
|
419
|
+
result
|
420
|
+
end
|
421
|
+
.,.,
|
384
422
|
|
385
|
-
module_eval(<<'.,.,', 'parser.y',
|
423
|
+
module_eval(<<'.,.,', 'parser.y', 60)
|
386
424
|
def _reduce_20(val, _values, result)
|
387
425
|
result = Lineup.new( name: val[0] )
|
388
426
|
|
@@ -390,7 +428,7 @@ module_eval(<<'.,.,', 'parser.y', 58)
|
|
390
428
|
end
|
391
429
|
.,.,
|
392
430
|
|
393
|
-
module_eval(<<'.,.,', 'parser.y',
|
431
|
+
module_eval(<<'.,.,', 'parser.y', 64)
|
394
432
|
def _reduce_21(val, _values, result)
|
395
433
|
kwargs = { name: val[0] }.merge( val[1] )
|
396
434
|
result = Lineup.new( **kwargs )
|
@@ -399,7 +437,7 @@ module_eval(<<'.,.,', 'parser.y', 62)
|
|
399
437
|
end
|
400
438
|
.,.,
|
401
439
|
|
402
|
-
module_eval(<<'.,.,', 'parser.y',
|
440
|
+
module_eval(<<'.,.,', 'parser.y', 70)
|
403
441
|
def _reduce_22(val, _values, result)
|
404
442
|
result = { card: val[0] }
|
405
443
|
|
@@ -407,7 +445,7 @@ module_eval(<<'.,.,', 'parser.y', 68)
|
|
407
445
|
end
|
408
446
|
.,.,
|
409
447
|
|
410
|
-
module_eval(<<'.,.,', 'parser.y',
|
448
|
+
module_eval(<<'.,.,', 'parser.y', 74)
|
411
449
|
def _reduce_23(val, _values, result)
|
412
450
|
result = { card: val[0], sub: val[1] }
|
413
451
|
|
@@ -415,7 +453,7 @@ module_eval(<<'.,.,', 'parser.y', 72)
|
|
415
453
|
end
|
416
454
|
.,.,
|
417
455
|
|
418
|
-
module_eval(<<'.,.,', 'parser.y',
|
456
|
+
module_eval(<<'.,.,', 'parser.y', 78)
|
419
457
|
def _reduce_24(val, _values, result)
|
420
458
|
result = { sub: val[0] }
|
421
459
|
|
@@ -423,7 +461,7 @@ module_eval(<<'.,.,', 'parser.y', 76)
|
|
423
461
|
end
|
424
462
|
.,.,
|
425
463
|
|
426
|
-
module_eval(<<'.,.,', 'parser.y',
|
464
|
+
module_eval(<<'.,.,', 'parser.y', 84)
|
427
465
|
def _reduce_25(val, _values, result)
|
428
466
|
result = Sub.new( minute: val[1], sub: val[2] )
|
429
467
|
|
@@ -431,7 +469,7 @@ module_eval(<<'.,.,', 'parser.y', 82)
|
|
431
469
|
end
|
432
470
|
.,.,
|
433
471
|
|
434
|
-
module_eval(<<'.,.,', 'parser.y',
|
472
|
+
module_eval(<<'.,.,', 'parser.y', 90)
|
435
473
|
def _reduce_26(val, _values, result)
|
436
474
|
kwargs = val[1]
|
437
475
|
result = Card.new( **kwargs )
|
@@ -440,14 +478,14 @@ module_eval(<<'.,.,', 'parser.y', 88)
|
|
440
478
|
end
|
441
479
|
.,.,
|
442
480
|
|
443
|
-
module_eval(<<'.,.,', 'parser.y',
|
481
|
+
module_eval(<<'.,.,', 'parser.y', 95)
|
444
482
|
def _reduce_27(val, _values, result)
|
445
483
|
result = { name: val[0] }
|
446
484
|
result
|
447
485
|
end
|
448
486
|
.,.,
|
449
487
|
|
450
|
-
module_eval(<<'.,.,', 'parser.y',
|
488
|
+
module_eval(<<'.,.,', 'parser.y', 98)
|
451
489
|
def _reduce_28(val, _values, result)
|
452
490
|
result = { name: val[0], minute: val[1] }
|
453
491
|
result
|
@@ -458,7 +496,7 @@ module_eval(<<'.,.,', 'parser.y', 96)
|
|
458
496
|
|
459
497
|
# reduce 30 omitted
|
460
498
|
|
461
|
-
module_eval(<<'.,.,', 'parser.y',
|
499
|
+
module_eval(<<'.,.,', 'parser.y', 109)
|
462
500
|
def _reduce_31(val, _values, result)
|
463
501
|
@tree << GroupDef.new( name: val[0],
|
464
502
|
teams: val[2] )
|
@@ -467,7 +505,7 @@ module_eval(<<'.,.,', 'parser.y', 107)
|
|
467
505
|
end
|
468
506
|
.,.,
|
469
507
|
|
470
|
-
module_eval(<<'.,.,', 'parser.y',
|
508
|
+
module_eval(<<'.,.,', 'parser.y', 115)
|
471
509
|
def _reduce_32(val, _values, result)
|
472
510
|
result = val
|
473
511
|
## e.g. val is ["Austria"]
|
@@ -476,7 +514,7 @@ module_eval(<<'.,.,', 'parser.y', 113)
|
|
476
514
|
end
|
477
515
|
.,.,
|
478
516
|
|
479
|
-
module_eval(<<'.,.,', 'parser.y',
|
517
|
+
module_eval(<<'.,.,', 'parser.y', 119)
|
480
518
|
def _reduce_33(val, _values, result)
|
481
519
|
result.push( val[1] )
|
482
520
|
|
@@ -484,7 +522,7 @@ module_eval(<<'.,.,', 'parser.y', 117)
|
|
484
522
|
end
|
485
523
|
.,.,
|
486
524
|
|
487
|
-
module_eval(<<'.,.,', 'parser.y',
|
525
|
+
module_eval(<<'.,.,', 'parser.y', 128)
|
488
526
|
def _reduce_34(val, _values, result)
|
489
527
|
kwargs = { name: val[0] }.merge( val[2] )
|
490
528
|
@tree<< RoundDef.new( **kwargs )
|
@@ -493,21 +531,21 @@ module_eval(<<'.,.,', 'parser.y', 126)
|
|
493
531
|
end
|
494
532
|
.,.,
|
495
533
|
|
496
|
-
module_eval(<<'.,.,', 'parser.y',
|
534
|
+
module_eval(<<'.,.,', 'parser.y', 133)
|
497
535
|
def _reduce_35(val, _values, result)
|
498
536
|
result = { date: val[0][1] }
|
499
537
|
result
|
500
538
|
end
|
501
539
|
.,.,
|
502
540
|
|
503
|
-
module_eval(<<'.,.,', 'parser.y',
|
541
|
+
module_eval(<<'.,.,', 'parser.y', 134)
|
504
542
|
def _reduce_36(val, _values, result)
|
505
543
|
result = { duration: val[0][1] }
|
506
544
|
result
|
507
545
|
end
|
508
546
|
.,.,
|
509
547
|
|
510
|
-
module_eval(<<'.,.,', 'parser.y',
|
548
|
+
module_eval(<<'.,.,', 'parser.y', 140)
|
511
549
|
def _reduce_37(val, _values, result)
|
512
550
|
@tree << DateHeader.new( date: val[0][1] )
|
513
551
|
|
@@ -515,7 +553,7 @@ module_eval(<<'.,.,', 'parser.y', 138)
|
|
515
553
|
end
|
516
554
|
.,.,
|
517
555
|
|
518
|
-
module_eval(<<'.,.,', 'parser.y',
|
556
|
+
module_eval(<<'.,.,', 'parser.y', 144)
|
519
557
|
def _reduce_38(val, _values, result)
|
520
558
|
@tree << DateHeader.new( date: val[1][1] )
|
521
559
|
|
@@ -523,7 +561,7 @@ module_eval(<<'.,.,', 'parser.y', 142)
|
|
523
561
|
end
|
524
562
|
.,.,
|
525
563
|
|
526
|
-
module_eval(<<'.,.,', 'parser.y',
|
564
|
+
module_eval(<<'.,.,', 'parser.y', 151)
|
527
565
|
def _reduce_39(val, _values, result)
|
528
566
|
@tree << GroupHeader.new( name: val[0] )
|
529
567
|
|
@@ -531,7 +569,7 @@ module_eval(<<'.,.,', 'parser.y', 149)
|
|
531
569
|
end
|
532
570
|
.,.,
|
533
571
|
|
534
|
-
module_eval(<<'.,.,', 'parser.y',
|
572
|
+
module_eval(<<'.,.,', 'parser.y', 161)
|
535
573
|
def _reduce_40(val, _values, result)
|
536
574
|
@tree << RoundHeader.new( names: val[0] )
|
537
575
|
|
@@ -539,14 +577,14 @@ module_eval(<<'.,.,', 'parser.y', 159)
|
|
539
577
|
end
|
540
578
|
.,.,
|
541
579
|
|
542
|
-
module_eval(<<'.,.,', 'parser.y',
|
580
|
+
module_eval(<<'.,.,', 'parser.y', 164)
|
543
581
|
def _reduce_41(val, _values, result)
|
544
582
|
result = val
|
545
583
|
result
|
546
584
|
end
|
547
585
|
.,.,
|
548
586
|
|
549
|
-
module_eval(<<'.,.,', 'parser.y',
|
587
|
+
module_eval(<<'.,.,', 'parser.y', 165)
|
550
588
|
def _reduce_42(val, _values, result)
|
551
589
|
result.push( val[2] )
|
552
590
|
result
|
@@ -557,21 +595,16 @@ module_eval(<<'.,.,', 'parser.y', 163)
|
|
557
595
|
|
558
596
|
# reduce 44 omitted
|
559
597
|
|
560
|
-
module_eval(<<'.,.,', 'parser.y',
|
598
|
+
module_eval(<<'.,.,', 'parser.y', 176)
|
561
599
|
def _reduce_45(val, _values, result)
|
562
|
-
|
563
|
-
pp val[1]
|
564
|
-
puts "more match opts:"
|
565
|
-
pp val[2]
|
566
|
-
|
567
|
-
kwargs = {}.merge( val[0], val[1], val[2] )
|
600
|
+
kwargs = {}.merge( val[0], val[1], val[2] )
|
568
601
|
@tree << MatchLine.new( **kwargs )
|
569
602
|
|
570
603
|
result
|
571
604
|
end
|
572
605
|
.,.,
|
573
606
|
|
574
|
-
module_eval(<<'.,.,', 'parser.y',
|
607
|
+
module_eval(<<'.,.,', 'parser.y', 181)
|
575
608
|
def _reduce_46(val, _values, result)
|
576
609
|
kwargs = {}.merge( val[0], val[1] )
|
577
610
|
@tree << MatchLine.new( **kwargs )
|
@@ -582,109 +615,190 @@ module_eval(<<'.,.,', 'parser.y', 184)
|
|
582
615
|
|
583
616
|
module_eval(<<'.,.,', 'parser.y', 189)
|
584
617
|
def _reduce_47(val, _values, result)
|
585
|
-
|
618
|
+
kwargs = {}.merge( val[0], val[1] )
|
619
|
+
@tree << MatchLine.new( **kwargs )
|
620
|
+
|
621
|
+
## add more match fixtures
|
622
|
+
val[3].each do |kwargs|
|
623
|
+
@tree << MatchLine.new( **kwargs)
|
624
|
+
end
|
625
|
+
|
586
626
|
result
|
587
627
|
end
|
588
628
|
.,.,
|
589
629
|
|
590
|
-
module_eval(<<'.,.,', 'parser.y',
|
630
|
+
module_eval(<<'.,.,', 'parser.y', 199)
|
591
631
|
def _reduce_48(val, _values, result)
|
592
|
-
|
632
|
+
kwargs = val[0]
|
633
|
+
@tree << MatchLine.new( **kwargs )
|
634
|
+
|
635
|
+
## add more match fixtures
|
636
|
+
val[2].each do |kwargs|
|
637
|
+
@tree << MatchLine.new( **kwargs)
|
638
|
+
end
|
639
|
+
|
593
640
|
result
|
594
641
|
end
|
595
642
|
.,.,
|
596
643
|
|
597
|
-
|
644
|
+
module_eval(<<'.,.,', 'parser.y', 213)
|
645
|
+
def _reduce_49(val, _values, result)
|
646
|
+
puts " REDUCE => more_match_fixtures : match_fixture"
|
647
|
+
result = val
|
598
648
|
|
599
|
-
module_eval(<<'.,.,', 'parser.y', 194)
|
600
|
-
def _reduce_50(val, _values, result)
|
601
|
-
result = { date: val[0][1]}
|
602
649
|
result
|
603
650
|
end
|
604
651
|
.,.,
|
605
652
|
|
606
|
-
module_eval(<<'.,.,', 'parser.y',
|
607
|
-
def
|
608
|
-
|
653
|
+
module_eval(<<'.,.,', 'parser.y', 218)
|
654
|
+
def _reduce_50(val, _values, result)
|
655
|
+
puts " REDUCE => more_match_fixtures : more_match_fixtures ',' match_fixture "
|
656
|
+
result.push( val[2] )
|
657
|
+
|
609
658
|
result
|
610
659
|
end
|
611
660
|
.,.,
|
612
661
|
|
613
|
-
module_eval(<<'.,.,', 'parser.y',
|
614
|
-
def
|
615
|
-
result = {
|
662
|
+
module_eval(<<'.,.,', 'parser.y', 224)
|
663
|
+
def _reduce_51(val, _values, result)
|
664
|
+
result = { ord: val[0][1][:value] }
|
616
665
|
result
|
617
666
|
end
|
618
667
|
.,.,
|
619
668
|
|
620
|
-
module_eval(<<'.,.,', 'parser.y',
|
621
|
-
def
|
622
|
-
|
669
|
+
module_eval(<<'.,.,', 'parser.y', 225)
|
670
|
+
def _reduce_52(val, _values, result)
|
671
|
+
result = { ord: val[0][1][:value] }.merge( val[1] )
|
623
672
|
result
|
624
673
|
end
|
625
674
|
.,.,
|
626
675
|
|
627
|
-
|
676
|
+
# reduce 53 omitted
|
677
|
+
|
678
|
+
module_eval(<<'.,.,', 'parser.y', 229)
|
628
679
|
def _reduce_54(val, _values, result)
|
629
|
-
|
680
|
+
result = { date: val[0][1]}
|
630
681
|
result
|
631
682
|
end
|
632
683
|
.,.,
|
633
684
|
|
634
|
-
module_eval(<<'.,.,', 'parser.y',
|
685
|
+
module_eval(<<'.,.,', 'parser.y', 230)
|
635
686
|
def _reduce_55(val, _values, result)
|
636
|
-
|
687
|
+
result = { date: val[0][1], time: val[1][1] }
|
637
688
|
result
|
638
689
|
end
|
639
690
|
.,.,
|
640
691
|
|
641
|
-
module_eval(<<'.,.,', 'parser.y',
|
692
|
+
module_eval(<<'.,.,', 'parser.y', 231)
|
642
693
|
def _reduce_56(val, _values, result)
|
643
|
-
|
694
|
+
result = { time: val[0][1]}
|
644
695
|
result
|
645
696
|
end
|
646
697
|
.,.,
|
647
698
|
|
648
|
-
module_eval(<<'.,.,', 'parser.y',
|
699
|
+
module_eval(<<'.,.,', 'parser.y', 237)
|
649
700
|
def _reduce_57(val, _values, result)
|
650
|
-
|
701
|
+
## todo - add possible status_notes too!!!
|
702
|
+
result = { status: val[0][1][:status] }
|
703
|
+
|
651
704
|
result
|
652
705
|
end
|
653
706
|
.,.,
|
654
707
|
|
655
|
-
module_eval(<<'.,.,', 'parser.y',
|
708
|
+
module_eval(<<'.,.,', 'parser.y', 242)
|
656
709
|
def _reduce_58(val, _values, result)
|
657
|
-
|
658
|
-
team2: val[2]
|
659
|
-
}.merge( val[1] )
|
710
|
+
result = { status: val[0][1][:status] }.merge( val[1] )
|
660
711
|
|
661
712
|
result
|
662
713
|
end
|
663
714
|
.,.,
|
664
715
|
|
665
|
-
module_eval(<<'.,.,', 'parser.y',
|
716
|
+
module_eval(<<'.,.,', 'parser.y', 244)
|
666
717
|
def _reduce_59(val, _values, result)
|
667
|
-
|
718
|
+
result = {}.merge( val[0] )
|
668
719
|
result
|
669
720
|
end
|
670
721
|
.,.,
|
671
722
|
|
672
|
-
module_eval(<<'.,.,', 'parser.y',
|
723
|
+
module_eval(<<'.,.,', 'parser.y', 245)
|
673
724
|
def _reduce_60(val, _values, result)
|
674
|
-
|
725
|
+
result = {}
|
675
726
|
result
|
676
727
|
end
|
677
728
|
.,.,
|
678
729
|
|
679
|
-
module_eval(<<'.,.,', 'parser.y',
|
730
|
+
module_eval(<<'.,.,', 'parser.y', 251)
|
680
731
|
def _reduce_61(val, _values, result)
|
681
|
-
|
732
|
+
result = { geo: val[1] }
|
682
733
|
result
|
683
734
|
end
|
684
735
|
.,.,
|
685
736
|
|
686
|
-
module_eval(<<'.,.,', 'parser.y',
|
737
|
+
module_eval(<<'.,.,', 'parser.y', 252)
|
687
738
|
def _reduce_62(val, _values, result)
|
739
|
+
result = { geo: val[1], timezone: val[2] }
|
740
|
+
result
|
741
|
+
end
|
742
|
+
.,.,
|
743
|
+
|
744
|
+
module_eval(<<'.,.,', 'parser.y', 255)
|
745
|
+
def _reduce_63(val, _values, result)
|
746
|
+
result = val
|
747
|
+
result
|
748
|
+
end
|
749
|
+
.,.,
|
750
|
+
|
751
|
+
module_eval(<<'.,.,', 'parser.y', 256)
|
752
|
+
def _reduce_64(val, _values, result)
|
753
|
+
result.push( val[2] )
|
754
|
+
result
|
755
|
+
end
|
756
|
+
.,.,
|
757
|
+
|
758
|
+
# reduce 65 omitted
|
759
|
+
|
760
|
+
# reduce 66 omitted
|
761
|
+
|
762
|
+
module_eval(<<'.,.,', 'parser.y', 264)
|
763
|
+
def _reduce_67(val, _values, result)
|
764
|
+
puts " match MATCH_FIXTURE"
|
765
|
+
result = { team1: val[0],
|
766
|
+
team2: val[2] }
|
767
|
+
|
768
|
+
result
|
769
|
+
end
|
770
|
+
.,.,
|
771
|
+
|
772
|
+
# reduce 68 omitted
|
773
|
+
|
774
|
+
# reduce 69 omitted
|
775
|
+
|
776
|
+
module_eval(<<'.,.,', 'parser.y', 275)
|
777
|
+
def _reduce_70(val, _values, result)
|
778
|
+
puts " match TEXT SCORE TEXT"
|
779
|
+
result = { team1: val[0],
|
780
|
+
team2: val[2],
|
781
|
+
score: val[1][1]
|
782
|
+
}
|
783
|
+
|
784
|
+
result
|
785
|
+
end
|
786
|
+
.,.,
|
787
|
+
|
788
|
+
module_eval(<<'.,.,', 'parser.y', 289)
|
789
|
+
def _reduce_71(val, _values, result)
|
790
|
+
puts " match TEXT match_sep TEXT SCORE"
|
791
|
+
result = { team1: val[0],
|
792
|
+
team2: val[2],
|
793
|
+
score: val[3][1]
|
794
|
+
}
|
795
|
+
|
796
|
+
result
|
797
|
+
end
|
798
|
+
.,.,
|
799
|
+
|
800
|
+
module_eval(<<'.,.,', 'parser.y', 311)
|
801
|
+
def _reduce_72(val, _values, result)
|
688
802
|
kwargs = val[1]
|
689
803
|
@tree << GoalLine.new( **kwargs )
|
690
804
|
|
@@ -692,8 +806,8 @@ module_eval(<<'.,.,', 'parser.y', 238)
|
|
692
806
|
end
|
693
807
|
.,.,
|
694
808
|
|
695
|
-
module_eval(<<'.,.,', 'parser.y',
|
696
|
-
def
|
809
|
+
module_eval(<<'.,.,', 'parser.y', 316)
|
810
|
+
def _reduce_73(val, _values, result)
|
697
811
|
kwargs = val[0]
|
698
812
|
@tree << GoalLine.new( **kwargs )
|
699
813
|
|
@@ -701,8 +815,8 @@ module_eval(<<'.,.,', 'parser.y', 243)
|
|
701
815
|
end
|
702
816
|
.,.,
|
703
817
|
|
704
|
-
module_eval(<<'.,.,', 'parser.y',
|
705
|
-
def
|
818
|
+
module_eval(<<'.,.,', 'parser.y', 321)
|
819
|
+
def _reduce_74(val, _values, result)
|
706
820
|
result = { goals1: val[0],
|
707
821
|
goals2: [] }
|
708
822
|
|
@@ -710,8 +824,8 @@ module_eval(<<'.,.,', 'parser.y', 248)
|
|
710
824
|
end
|
711
825
|
.,.,
|
712
826
|
|
713
|
-
module_eval(<<'.,.,', 'parser.y',
|
714
|
-
def
|
827
|
+
module_eval(<<'.,.,', 'parser.y', 324)
|
828
|
+
def _reduce_75(val, _values, result)
|
715
829
|
result = { goals1: [],
|
716
830
|
goals2: val[2] }
|
717
831
|
|
@@ -719,8 +833,8 @@ module_eval(<<'.,.,', 'parser.y', 251)
|
|
719
833
|
end
|
720
834
|
.,.,
|
721
835
|
|
722
|
-
module_eval(<<'.,.,', 'parser.y',
|
723
|
-
def
|
836
|
+
module_eval(<<'.,.,', 'parser.y', 327)
|
837
|
+
def _reduce_76(val, _values, result)
|
724
838
|
result = { goals1: val[0],
|
725
839
|
goals2: val[2] }
|
726
840
|
|
@@ -728,26 +842,26 @@ module_eval(<<'.,.,', 'parser.y', 254)
|
|
728
842
|
end
|
729
843
|
.,.,
|
730
844
|
|
731
|
-
# reduce
|
845
|
+
# reduce 77 omitted
|
732
846
|
|
733
|
-
# reduce
|
847
|
+
# reduce 78 omitted
|
734
848
|
|
735
|
-
module_eval(<<'.,.,', 'parser.y',
|
736
|
-
def
|
849
|
+
module_eval(<<'.,.,', 'parser.y', 341)
|
850
|
+
def _reduce_79(val, _values, result)
|
737
851
|
result = val
|
738
852
|
result
|
739
853
|
end
|
740
854
|
.,.,
|
741
855
|
|
742
|
-
module_eval(<<'.,.,', 'parser.y',
|
743
|
-
def
|
856
|
+
module_eval(<<'.,.,', 'parser.y', 342)
|
857
|
+
def _reduce_80(val, _values, result)
|
744
858
|
result.push( val[1])
|
745
859
|
result
|
746
860
|
end
|
747
861
|
.,.,
|
748
862
|
|
749
|
-
module_eval(<<'.,.,', 'parser.y',
|
750
|
-
def
|
863
|
+
module_eval(<<'.,.,', 'parser.y', 347)
|
864
|
+
def _reduce_81(val, _values, result)
|
751
865
|
result = Goal.new( player: val[0],
|
752
866
|
minutes: val[1] )
|
753
867
|
|
@@ -755,29 +869,29 @@ module_eval(<<'.,.,', 'parser.y', 274)
|
|
755
869
|
end
|
756
870
|
.,.,
|
757
871
|
|
758
|
-
module_eval(<<'.,.,', 'parser.y',
|
759
|
-
def
|
872
|
+
module_eval(<<'.,.,', 'parser.y', 354)
|
873
|
+
def _reduce_82(val, _values, result)
|
760
874
|
result = val
|
761
875
|
result
|
762
876
|
end
|
763
877
|
.,.,
|
764
878
|
|
765
|
-
module_eval(<<'.,.,', 'parser.y',
|
766
|
-
def
|
879
|
+
module_eval(<<'.,.,', 'parser.y', 355)
|
880
|
+
def _reduce_83(val, _values, result)
|
767
881
|
result.push( val[1])
|
768
882
|
result
|
769
883
|
end
|
770
884
|
.,.,
|
771
885
|
|
772
|
-
module_eval(<<'.,.,', 'parser.y',
|
773
|
-
def
|
886
|
+
module_eval(<<'.,.,', 'parser.y', 356)
|
887
|
+
def _reduce_84(val, _values, result)
|
774
888
|
result.push( val[2])
|
775
889
|
result
|
776
890
|
end
|
777
891
|
.,.,
|
778
892
|
|
779
|
-
module_eval(<<'.,.,', 'parser.y',
|
780
|
-
def
|
893
|
+
module_eval(<<'.,.,', 'parser.y', 362)
|
894
|
+
def _reduce_85(val, _values, result)
|
781
895
|
kwargs = {}.merge( val[0][1] )
|
782
896
|
result = Minute.new( **kwargs )
|
783
897
|
|
@@ -785,8 +899,8 @@ module_eval(<<'.,.,', 'parser.y', 289)
|
|
785
899
|
end
|
786
900
|
.,.,
|
787
901
|
|
788
|
-
module_eval(<<'.,.,', 'parser.y',
|
789
|
-
def
|
902
|
+
module_eval(<<'.,.,', 'parser.y', 367)
|
903
|
+
def _reduce_86(val, _values, result)
|
790
904
|
kwargs = { }.merge( val[0][1] ).merge( val[1] )
|
791
905
|
result = Minute.new( **kwargs )
|
792
906
|
|
@@ -794,22 +908,22 @@ module_eval(<<'.,.,', 'parser.y', 294)
|
|
794
908
|
end
|
795
909
|
.,.,
|
796
910
|
|
797
|
-
module_eval(<<'.,.,', 'parser.y',
|
798
|
-
def
|
911
|
+
module_eval(<<'.,.,', 'parser.y', 371)
|
912
|
+
def _reduce_87(val, _values, result)
|
799
913
|
result = { og: true }
|
800
914
|
result
|
801
915
|
end
|
802
916
|
.,.,
|
803
917
|
|
804
|
-
module_eval(<<'.,.,', 'parser.y',
|
805
|
-
def
|
918
|
+
module_eval(<<'.,.,', 'parser.y', 372)
|
919
|
+
def _reduce_88(val, _values, result)
|
806
920
|
result = { pen: true }
|
807
921
|
result
|
808
922
|
end
|
809
923
|
.,.,
|
810
924
|
|
811
|
-
module_eval(<<'.,.,', 'parser.y',
|
812
|
-
def
|
925
|
+
module_eval(<<'.,.,', 'parser.y', 377)
|
926
|
+
def _reduce_89(val, _values, result)
|
813
927
|
puts ' MATCH empty_line'
|
814
928
|
result
|
815
929
|
end
|
@@ -1,15 +1,16 @@
|
|
1
|
-
|
1
|
+
module SportDb
|
2
|
+
class Parser
|
3
|
+
|
2
4
|
## (match) status
|
3
5
|
## note: english usage - cancelled (in UK), canceled (in US)
|
4
6
|
##
|
5
7
|
## add more variants - why? why not?
|
6
8
|
|
7
9
|
|
8
|
-
|
9
|
-
|
10
10
|
STATUS_RE = %r{
|
11
|
-
|
12
|
-
|
11
|
+
\[
|
12
|
+
(?:
|
13
|
+
### opt 1 - allow long forms with note/comment for some stati
|
13
14
|
(?: (?<status> awarded
|
14
15
|
|
|
15
16
|
annulled
|
@@ -19,7 +20,8 @@ STATUS_RE = %r{
|
|
19
20
|
[ ]*
|
20
21
|
)
|
21
22
|
|
|
22
|
-
|
23
|
+
|
24
|
+
## opt 2 - short from only (no note/comments)
|
23
25
|
(?<status>
|
24
26
|
cancelled|canceled|can\.
|
25
27
|
|
|
@@ -33,6 +35,11 @@ STATUS_RE = %r{
|
|
33
35
|
|
|
34
36
|
annulled
|
35
37
|
)
|
36
|
-
|
37
|
-
|
38
|
+
)
|
39
|
+
\]
|
40
|
+
}ix
|
41
|
+
|
38
42
|
|
43
|
+
end # class Parser
|
44
|
+
end # module SportDb
|
45
|
+
|
data/lib/sportdb/parser.rb
CHANGED
@@ -17,6 +17,9 @@ require 'season/formats' # e.g. Season() support machinery
|
|
17
17
|
|
18
18
|
|
19
19
|
require_relative 'parser/version'
|
20
|
+
|
21
|
+
require_relative 'parser/lang'
|
22
|
+
|
20
23
|
require_relative 'parser/token-score'
|
21
24
|
require_relative 'parser/token-date'
|
22
25
|
require_relative 'parser/token-text'
|
@@ -24,7 +27,6 @@ require_relative 'parser/token-status'
|
|
24
27
|
require_relative 'parser/token'
|
25
28
|
require_relative 'parser/tokenizer'
|
26
29
|
|
27
|
-
require_relative 'parser/lang'
|
28
30
|
require_relative 'parser/parser'
|
29
31
|
|
30
32
|
|
@@ -51,6 +53,19 @@ end # module SportDb
|
|
51
53
|
|
52
54
|
|
53
55
|
module SportDb
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
class Parser
|
60
|
+
## keep "old" access to checking for group, round & friends
|
61
|
+
## for now for compatibility
|
62
|
+
def is_group?( text ) Lang.is_group?( text ); end
|
63
|
+
def is_round?( text ) Lang.is_round?( text ); end
|
64
|
+
def is_leg?( text ) Lang.is_leg?( text ); end
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
|
54
69
|
class Tokenizer
|
55
70
|
|
56
71
|
attr_reader :tokens
|
@@ -234,8 +249,10 @@ RoundHeader = Struct.new( :names ) do
|
|
234
249
|
end
|
235
250
|
|
236
251
|
MatchLine = Struct.new( :ord, :date, :time,
|
237
|
-
:team1, :team2, :score,
|
238
|
-
:
|
252
|
+
:team1, :team2, :score,
|
253
|
+
:status,
|
254
|
+
:geo,
|
255
|
+
:timezone ) do ## change to geos - why? why not?
|
239
256
|
|
240
257
|
def pretty_print( printer )
|
241
258
|
printer.text( "<MatchLine " )
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportdb-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocos
|