TUM-Dev/eat-api

fmi-bistro Parser broken

COM8 opened this issue · 5 comments

COM8 commented

The FMI-Bistro changed their PDF format.
This bricked our parser.
The problematic lines are:

eat-api/src/menu_parser.py

Lines 354 to 358 in 07324d7

lines_weekdays["mon"] += " " + line[pos_mon:pos_tue].replace("\n", " ").replace("Montag", "")
lines_weekdays["tue"] += " " + line[pos_tue:pos_wed].replace("\n", " ").replace("Dienstag", "")
lines_weekdays["wed"] += " " + line[pos_wed:pos_thu].replace("\n", " ").replace("Mittwoch", "")
lines_weekdays["thu"] += " " + line[pos_thu:pos_fri].replace("\n", " ").replace("Donnerstag", "")
lines_weekdays["fri"] += " " + line[pos_fri:].replace("\n", " ").replace("Freitag", "")

Here we assume, all lines (dishes) start with the same offset like Montag, Dienstag and so on.
But this is not the case any more.

Examples:

'                               Montag                                        Dienstag                                           Mittwoch                                          Donnerstag                                           Freitag'
'                      5 Stück Cevapcici                      Knusperschnitzel vom Hähnchen        Schweinebraten nach                                                    Yellow-Thaicurry von Huhn                              Schollenfilet gebacken'
'             von Rind auf Djwetschreis und Ajvar                 in Kornflakespanade dazu   Peperonata mit Rosmarinkartoffeln                                          mit Gemüse und Kokosmilch und                       mit Gemüse-Kartoffeln und Joghurt-'
'                                                             Kartoffelwedjes und Rahmgemüse                                                                                     Basmatireis                                            Dill-Dip'

ok, I'll work on it today

Could it be that the location of the PDF moved? Can't find anything here (this is also the webpage where the src.menu_parser.FMIBistroMenuParser looks at).

I wrote an email to the Wilhelm Gastronomie. Could it be that they are currently closed due to Corona?

COM8 commented

Since this Monday the FMI-Bistro is open again, but I don't think they are selling lunch right now.
https://www.wilhelm-gastronomie.de/Uni-Gastronomie/

They wrote me that they will publish a menu next week

They have published the menus now and I already started working on it