openfootball / worldcup

Free open public domain football data for the World Cup (incl. Qatar 2022, Russia 2018, Brazil 2014, etc.) and World Cup Quali(fiers)
Creative Commons Zero v1.0 Universal
544 stars 180 forks source link

Building the worldcup database fails with country not found #48

Closed dirkgomez closed 4 years ago

dirkgomez commented 4 years ago

Here's what I did, I created this Datafile:

####################################
# Datafile for World Cups
#
#  use
#    $ sportdb new worldcup

football 'world-cup'

Ran

sportdb new worldcup

which results in this:

(auto config) try matching teams:
["Uruguay", "Austria"]
[debug]    [parse_matchdata] hash: >{:day=>"4", :month_name=>"July"}<
[debug]    [calc_year] ????-7-4 -- start: 1954-01-01
[debug]    date: >1954-07-04<
(auto config) try matching teams:
["Hungary", "West Germany"]
** !!! ERROR - no match for national team >1-1  Yugoslavia< found

*** error: exit

I think this line cannot be parsed: https://github.com/openfootball/world-cup/blob/master/1954--switzerland/cup.txt#L21

geraldb commented 4 years ago

Thanks for trying sportdb and reporting the error and the analysis. If this line is the cause than the error must be the score format:

1-1 a.e.t. 1-1

I will double check as soon as I get to it, see https://github.com/sportdb/sport.db/blob/master/score-formats/lib/score-formats/formats.rb for all suported formats. A quick "hack" fix might be changing to:

1-1 a.e.t. (1-1)

You can try it locally e.g. unzip the archive or git clone - than change / patch the .txt datafile and than call sportdb build. Cheers. Prost.

dirkgomez commented 4 years ago

These commits fix quite a lot of the score recognition issues: https://github.com/dirkgomez/world-cup/commit/17abad5fb46f45bd6aa6570b284cd99289b8df89 and https://github.com/dirkgomez/world-cup/commit/b0c5eea09cb5062dc65e16d380138e69386b768b

However now I am troubled by this:

["Saudi Arabia", "Spain"]
[debug]    [parse_matchdata] hash: >{:day_name=>"Fri", :month_name=>"Jun", :day=>"23"}<
[debug]    [calc_year] ????-6-23 -- start: 2006-01-01
[debug]    date: >2006-06-23<
(auto config) try matching teams:
["Ukraine", "Tunisia"]
** !!! ERROR - no match for national team >Serbia and Montenegro< found

The entry for Serbia and Montenegro seems to be missing somewhere else - it is not a parsing issue here (e. g. simply replacing it with Trinidad and Tobago works fine)

yorobot commented 4 years ago

Wow. Thanks for taking the time and your help with updating the score to a more uniform format.

** !!! ERROR - no match for national team >Serbia and Montenegro< found

Sorry, yes - that (historic) country name is missing in the history section of the built-in / pre-configured countries, see https://github.com/sportdb/football.db/blob/master/fifa/config/countries.txt. I will add it later today and try to push out a new fifa gem / library. Thanks again.

Update: FYI: I have pulled in and committed your score format changes (thanks again!), see https://github.com/openfootball/world-cup/commits/master and added some more fixes for reported errors (while linting).

yorobot commented 4 years ago

FYI: I pushed / uploaded a new fifa gem / library, see https://rubygems.org/gems/fifa/versions/2020.9.13. If you update plus pull in the latest score format fixes all should be good. The linter reports 0 errros and the built went through (with my dev setup). If you still run into any errors, please report. Thanks again. Cheers.

yorobot commented 4 years ago

Thanks again for the score format fixes. Have a great weekend. Cheers.