sportdb-parser 0.6.13 → 0.6.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a2e9867bfc8e1dec97214c0d3c335fe0d3cdb0cf5835184081af1447d509e4a
4
- data.tar.gz: 1b038a316ad0de74bc559972e59832bfe3af5530b6c0547a9b2eaca0ecbfefbf
3
+ metadata.gz: 51b568bfcb315049faf125718d09615346959cdd7301934a5131cb0fac1b6f9b
4
+ data.tar.gz: c8bd6486e70d28d4b121a3fb1ebec206b46880571a2404de64418fd76fe8b039
5
5
  SHA512:
6
- metadata.gz: 11b6cb434a959e39b8dd8a935b9bb0d973e9e47e647c1f19dbc1c536a013b982dc948ca62c2d7a9a661a7aeb276444cfbfb81c4975df30ece993076124fce7bd
7
- data.tar.gz: b0487df7f949c28c0d4df23d040aeff4eb3247c01b088fe45b65aa6a29a3891781d24bd56d85e99cd1e0d31d82efe953c13f6c689301a9623a01ffa2bdbb45f0
6
+ metadata.gz: 1236c350c6b2cef3a7b9caff9b943ef09d69a02e5e6f2fe3ed55c5677d4a20ed17bba6423c77d035a4ea4c772bdaf598a81ee0738f25185ad2bbf5b63ab4e901
7
+ data.tar.gz: a16da2520f22b6392330bfbec90e2c8c2ca0f784bb31556ddb0140e25d53d7a293d6ca615b4a2a08d426e0069b0f6dcab8ed06ba35e688a03befa6429d9c732d
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.6.13
1
+ ### 0.6.14
2
2
  ### 0.0.1 / 2024-07-12
3
3
 
4
4
  * Everything is new. First release.
data/config/rounds_es.txt CHANGED
@@ -17,6 +17,9 @@ Zona B
17
17
  Final de Grupos
18
18
  Repechaje
19
19
 
20
+ Final Absoluta
21
+
22
+
20
23
  Copa Libertadores
21
24
  Copa Sudamericana
22
25
 
@@ -17,12 +17,17 @@ module Lang
17
17
  ## Group 1A or A1, B1 - used anywhere
18
18
  ## yes - A1, A2, B1, C1, etc. used in UEFA Nations League for example!!
19
19
  ##
20
+ ## exlcude
20
21
  ## use "key" of group - why? why not?
22
+ ##
23
+ ## note - will include group stage too
24
+ ## make sure is_round gets called before is_group for now!!!
21
25
 
22
26
  GROUP_RE = %r{^
23
27
  Group [ ]
24
- (?<key>[a-z0-9]+)
28
+ (?<key> [a-z0-9]+ )
25
29
  $}ix
30
+
26
31
  def self.is_group?( text )
27
32
  ## use regex for match
28
33
  GROUP_RE.match?( text )
@@ -182,13 +182,16 @@ def tokenize_with_errors
182
182
  ## pass 1
183
183
  ## replace all texts with keyword matches
184
184
  ## (e.g. group, round, leg, etc.)
185
+ ##
186
+ ## note - let is_round? get first (before is_group?)
187
+ ## will match group stage as round (NOT group)
185
188
  tokens = tokens.map do |t|
186
189
  if t[0] == :TEXT
187
190
  text = t[1]
188
- t = if is_group?( text )
191
+ t = if is_round?( text ) || is_leg?( text ) || is_zone?( text )
192
+ [:ROUND, text]
193
+ elsif is_group?( text )
189
194
  [:GROUP, text]
190
- elsif is_round?( text ) || is_leg?( text ) || is_zone?( text )
191
- [:ROUND, text]
192
195
  else
193
196
  t ## pass through as-is (1:1)
194
197
  end
@@ -359,6 +362,17 @@ def _tokenize_line( line )
359
362
  pos = offsets[1] ## update pos
360
363
  end
361
364
 
365
+ m = ROUND_OUTLINE_RE.match( line )
366
+ if m
367
+ puts " ROUND_OUTLINE" if debug?
368
+
369
+ tokens << [:ROUND_OUTLINE, m[:round_outline]]
370
+
371
+ ## note - eats-up line for now (change later to only eat-up marker e.g. »|>>)
372
+ offsets = [m.begin(0), m.end(0)]
373
+ pos = offsets[1] ## update pos
374
+ end
375
+
362
376
  m = PLAYER_WITH_SCORE_RE.match( line )
363
377
  if m
364
378
  ## switch context to GOAL_RE (goalline(s)
@@ -462,6 +476,8 @@ def _tokenize_line( line )
462
476
 
463
477
  case sym
464
478
  when ',' then [:',']
479
+ when '›' then [:','] ## note - treat geo sep › (unicode) like comma for now!!!
480
+ when '>' then [:','] ## note - treat geo sep > (ascii) like comma for now!!!
465
481
  when '[' then
466
482
  ## get out-off geo mode and backtrack (w/ next)
467
483
  puts " LEAVE GEO_RE MODE, BACK TO TOP_LEVEL/RE" if debug?