sportdb-parser 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c4d7c1c55b5122f11fc1fdd863e2b8a5cc929b9ae9c57bcc0322400516ab4b8
4
- data.tar.gz: f5fcae93a1010e1d74fd4f453cb6a201f8f6e11de1ad0d0c9a572c9bb00bd540
3
+ metadata.gz: 2d3ea1789627c1b9380ab692b8731f0f8143d43fe20353a3b9b9413da0ef1876
4
+ data.tar.gz: f5a15299064a88cebcb7ebc7e4b56fc985e78c0f654d9c86347fa299d9cd5133
5
5
  SHA512:
6
- metadata.gz: 93cb2dc95acf74b1a26088afe3162f0f87a25e949d3f81cd6408c35ec9c42d7309a7c5f59a4c29870146b72e77ed6d5bc3e14c754abf2925b1564b55cafe0ac3
7
- data.tar.gz: 6de22cc1e40f8e423786cef7386ae890533a627b6877f6f17c73d47e6956b2de181c6f3d357a731be4476781c363abaab0de9b21c83a4f88f8b058f8a3a7d005
6
+ metadata.gz: 489259813cc34fc38fb8a16bda45ac6785c8f2d0ee148caf458c014fe4754e1f360985f37f8132f0212dd89b427c09d2cf6a0054853e6217a814dde5ea2de222
7
+ data.tar.gz: 3280fc2ebc7db55a9182abc0e7ef23e7d9689758b64741e4824c642a6ad89b4e16eae5d52c666ec75c295919607d255f55ebaa63e1ad68ad95dc1e6717812a6b
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.3.3
1
+ ### 0.3.4
2
2
 
3
3
  ### 0.0.1 / 2024-07-12
4
4
 
data/Manifest.txt CHANGED
@@ -12,6 +12,7 @@ lib/sportdb/parser/outline_reader.rb
12
12
  lib/sportdb/parser/parser.rb
13
13
  lib/sportdb/parser/token-date.rb
14
14
  lib/sportdb/parser/token-score.rb
15
+ lib/sportdb/parser/token-status.rb
15
16
  lib/sportdb/parser/token-text.rb
16
17
  lib/sportdb/parser/token.rb
17
18
  lib/sportdb/parser/version.rb
@@ -3,7 +3,7 @@ module Fbtok
3
3
  def self.main( args=ARGV )
4
4
 
5
5
  opts = {
6
- debug: true,
6
+ debug: false,
7
7
  metal: false,
8
8
  file: nil,
9
9
  }
@@ -12,14 +12,14 @@ def self.main( args=ARGV )
12
12
  parser.banner = "Usage: #{$PROGRAM_NAME} [options]"
13
13
 
14
14
 
15
- parser.on( "-q", "--quiet",
16
- "less debug output/messages - default is (#{!opts[:debug]})" ) do |debug|
17
- opts[:debug] = false
18
- end
19
- # parser.on( "--verbose", "--debug",
20
- # "turn on verbose / debug output (default: #{opts[:debug]})" ) do |debug|
21
- # opts[:debug] = true
15
+ # parser.on( "-q", "--quiet",
16
+ # "less debug output/messages - default is (#{!opts[:debug]})" ) do |debug|
17
+ # opts[:debug] = false
22
18
  # end
19
+ parser.on( "--verbose", "--debug",
20
+ "turn on verbose / debug output (default: #{opts[:debug]})" ) do |debug|
21
+ opts[:debug] = true
22
+ end
23
23
 
24
24
  parser.on( "--metal",
25
25
  "turn off typed parse tree; show to the metal tokens"+
@@ -0,0 +1,38 @@
1
+
2
+ ## (match) status
3
+ ## note: english usage - cancelled (in UK), canceled (in US)
4
+ ##
5
+ ## add more variants - why? why not?
6
+
7
+
8
+
9
+
10
+ STATUS_RE = %r{
11
+ \[
12
+ ### allow long forms with note/comment for some stati
13
+ (?: (?<status> awarded
14
+ |
15
+ annulled
16
+ |
17
+ abandoned
18
+ ) [ ;,]* (?<status_note> [^\]]+ )
19
+ [ ]*
20
+ )
21
+ |
22
+ ## short from only (no note/comments)
23
+ (?<status>
24
+ cancelled|canceled|can\.
25
+ |
26
+ abandoned|abd\.
27
+ |
28
+ postponed
29
+ |
30
+ awarded|awd\.
31
+ |
32
+ replay
33
+ |
34
+ annulled
35
+ )
36
+ \]
37
+ }ix
38
+
@@ -100,33 +100,6 @@ MINUTE_RE = %r{
100
100
  }ix
101
101
 
102
102
 
103
- ## (match) status
104
- ## note: english usage - cancelled (in UK), canceled (in US)
105
- ##
106
- ## add more variants - why? why not?
107
-
108
- STATUS_RE = %r{
109
- (?<status>
110
- \b
111
- (?:
112
- cancelled|canceled|can\.
113
- |
114
- abandoned|abd\.
115
- |
116
- postponed
117
- |
118
- awarded|awd\.
119
- |
120
- replay
121
- )
122
- (?=[ \]]|$)
123
- )}ix
124
-
125
- ## todo/check: remove loakahead assertion here - why require space?
126
- ## note: \b works only after non-alphanum
127
- ## to make it work with awd. (dot) "custom" lookahead neeeded
128
-
129
-
130
103
  ## goal types
131
104
  # (pen.) or (pen) or (p.) or (p)
132
105
  ## (o.g.) or (og)
@@ -146,8 +119,8 @@ GOAL_OG_RE = %r{
146
119
 
147
120
 
148
121
 
149
- RE = Regexp.union( STATUS_RE,
150
- TIMEZONE_RE,
122
+ RE = Regexp.union( STATUS_RE,
123
+ TIMEZONE_RE,
151
124
  TIME_RE,
152
125
  DURATION_RE, # note - duration MUST match before date
153
126
  DATE_RE,
@@ -216,7 +189,11 @@ def tokenize_with_errors( line, typed: false,
216
189
  elsif m[:text]
217
190
  [:text, m[:text]] ## keep pos - why? why not?
218
191
  elsif m[:status] ## (match) status e.g. cancelled, awarded, etc.
219
- [:status, m[:status]]
192
+ if m[:status_note] ## includes note? e.g. awarded; originally 2-0
193
+ [:status, m[:status], {note:m[:status_note]}]
194
+ else
195
+ [:status, m[:status]]
196
+ end
220
197
  elsif m[:time]
221
198
  if typed
222
199
  ## unify to iso-format
@@ -4,7 +4,7 @@ module SportDb
4
4
  module Parser
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
6
  MINOR = 3
7
- PATCH = 3
7
+ PATCH = 4
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
@@ -23,6 +23,7 @@ require_relative 'parser/version'
23
23
  require_relative 'parser/token-score'
24
24
  require_relative 'parser/token-date'
25
25
  require_relative 'parser/token-text'
26
+ require_relative 'parser/token-status'
26
27
  require_relative 'parser/token'
27
28
  require_relative 'parser/lang'
28
29
  require_relative 'parser/parser'
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.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-19 00:00:00.000000000 Z
11
+ date: 2024-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocos
@@ -96,6 +96,7 @@ files:
96
96
  - lib/sportdb/parser/parser.rb
97
97
  - lib/sportdb/parser/token-date.rb
98
98
  - lib/sportdb/parser/token-score.rb
99
+ - lib/sportdb/parser/token-status.rb
99
100
  - lib/sportdb/parser/token-text.rb
100
101
  - lib/sportdb/parser/token.rb
101
102
  - lib/sportdb/parser/version.rb