sportdb-parser 0.6.7 → 0.6.8

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: 366948a35eecdf2ea0b1e83e48a4ae53b399f5f91436c066e8b3328fb3d9dda4
4
- data.tar.gz: 8fba19e829e8d81873f4a263c5d0b2a1db27095fddebb90233a0d075c2ec7ea4
3
+ metadata.gz: b8d65c02b835d52ddb9f7fd61bd44dd6ff4392bd7ddcef751dcc2ec7a0934065
4
+ data.tar.gz: 92b797acbb7c1652ea50910207f86ae53fa5097bec9acaadeae96e161b005aa2
5
5
  SHA512:
6
- metadata.gz: d4cc2627f892ab128df8cbccab77117dd97b85ac9b9900f0434f4ada02fdad1ba7a19cf6055aeb7a88fe1dce477190bfa8b028276837e30546bce0656ba4f901
7
- data.tar.gz: 671f21e8bdb895223504e2b8776905d169c7ba97086cf843ebcc6e361a074eaad4c2fa62c6296328e265bae511eb4c4574bbdfd3d76ce92649212547898f726a
6
+ metadata.gz: dee3a2ff615fe8789593db7f627d00a1f3931d18bc150af50e75c4d68b9ad74c87dc359ebfe4268a5f974de7c681b4ddfdb4cd87e66b69b86c4fd6633c1b98a5
7
+ data.tar.gz: 54762780eb57ba090caa44c4efd53e2fcc8149c87a2aa97b7d052efc58f51da5d4f2f49cfe4ce7b1a45db437a3c9d82856cf7bb887382f75942acda6f495be4c
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.6.7
1
+ ### 0.6.8
2
2
  ### 0.0.1 / 2024-07-12
3
3
 
4
4
  * Everything is new. First release.
data/config/rounds_en.txt CHANGED
@@ -17,6 +17,10 @@ Major Semi-Final
17
17
  Minor Semi-Final
18
18
 
19
19
 
20
+ 1/8 Finals
21
+
22
+
23
+
20
24
  ## keep weirdo matchday ??
21
25
  Matchday 0 ## in 2003-04/az.1.txt
22
26
 
@@ -15,6 +15,7 @@ module Lang
15
15
  ## Group 1-99
16
16
  ## Group HEX # used in concaf world cup quali
17
17
  ## Group 1A or A1, B1 - used anywhere
18
+ ## yes - A1, A2, B1, C1, etc. used in UEFA Nations League for example!!
18
19
  ##
19
20
  ## use "key" of group - why? why not?
20
21
 
@@ -197,7 +198,17 @@ end
197
198
 
198
199
 
199
200
  def self.is_round?( text )
200
- ROUND_RE.match?( text ) || more_round_names.include?( text )
201
+ ### note - use check for case-insensitive
202
+ ## was:
203
+ ## more_round_names.include?( text )
204
+ ## change to:
205
+ ## more_round_names.any?{ |str| str.casecmp( text )==0 }
206
+ ##
207
+ ## todo/fix:
208
+ ## maybe in the future use our own unaccent and downcase - wyh? why not?
209
+ ## note - for now ROUND_RE is also case-insensitive!!
210
+
211
+ ROUND_RE.match?( text ) || more_round_names.any?{ |str| str.casecmp( text )==0 }
201
212
  end
202
213
 
203
214
  ##
@@ -344,6 +344,9 @@ def _tokenize_line( line )
344
344
  elsif ['goals'].include?( key.downcase )
345
345
  @re = PROP_GOAL_RE
346
346
  tokens << [:PROP_GOALS, m[:key]]
347
+ elsif ['penalties', 'penalty shootout'].include?( key.downcase )
348
+ @re = PROP_PENALTIES_RE
349
+ tokens << [:PROP_PENALTIES, m[:key]]
347
350
  else ## assume (team) line-up
348
351
  @re = PROP_RE ## use LINEUP_RE ???
349
352
  tokens << [:PROP, m[:key]]
@@ -511,6 +514,38 @@ def _tokenize_line( line )
511
514
  puts "!!! TOKENIZE ERROR (PROP_RE) - no match found"
512
515
  nil
513
516
  end
517
+ elsif @re == PROP_PENALTIES_RE
518
+ if m[:space] || m[:spaces]
519
+ nil ## skip space(s)
520
+ elsif m[:prop_name] ## note - change prop_name to player
521
+ [:PROP_NAME, m[:name]] ### use PLAYER for token - why? why not?
522
+ elsif m[:enclosed_name]
523
+ ## use HOLD,SAVE,POST or such keys - why? why not?
524
+ [:ENCLOSED_NAME, m[:name]]
525
+ elsif m[:score]
526
+ score = {}
527
+ ## must always have ft for now e.g. 1-1 or such
528
+ ### change to (generic) score from ft -
529
+ ## might be score a.e.t. or such - why? why not?
530
+ score[:ft] = [m[:ft1].to_i(10),
531
+ m[:ft2].to_i(10)]
532
+ ## note - for debugging keep (pass along) "literal" score
533
+ [:SCORE, [m[:score], score]]
534
+ elsif m[:sym]
535
+ sym = m[:sym]
536
+ case sym
537
+ when ',' then [:',']
538
+ when ';' then [:';']
539
+ when '[' then [:'[']
540
+ when ']' then [:']']
541
+ else
542
+ nil ## ignore others (e.g. brackets [])
543
+ end
544
+ else
545
+ ## report error
546
+ puts "!!! TOKENIZE ERROR (PROP_PENALTIES_RE) - no match found"
547
+ nil
548
+ end
514
549
  elsif @re == GOAL_RE || @re == PROP_GOAL_RE
515
550
  if m[:space] || m[:spaces]
516
551
  nil ## skip space(s)
@@ -715,7 +750,8 @@ def _tokenize_line( line )
715
750
  ##
716
751
  ## if in prop mode continue if last token is [,-]
717
752
  ## otherwise change back to "standard" mode
718
- if @re == PROP_RE || @re == PROP_CARDS_RE || @re == PROP_GOAL_RE
753
+ if @re == PROP_RE || @re == PROP_CARDS_RE ||
754
+ @re == PROP_GOAL_RE || @re == PROP_PENALTIES_RE
719
755
  if [:',', :'-', :';'].include?( tokens[-1][0] )
720
756
  ## continue/stay in PROP_RE mode
721
757
  ## todo/check - auto-add PROP_CONT token or such