ErwinKomen / RU-wnd

Dutch language dialect dictionaries, Radboud University Nijmegen
0 stars 0 forks source link

WGD: adapt import behaviour #46

Closed ErwinKomen closed 2 years ago

ErwinKomen commented 2 years ago

The behaviour of importing data (afresh) should be adjusted to accommodate for the following desires of the researcher:

  • Alleen opnemen als er een standaardspelling is (bij een aantal lemma’s is er geen variatie inde standaardspelling)
  • Als de variabele ‘inwoordenboek’ de waarde ’nee’ is, de opgave van kleur voorzien
  • Dezelfde standaardspellingen van eenzelfde plaats worden slechts 1 keer weergegeven (door een of andere oorzaak, bevat het bestand van de ‘wereld’ veel dubbele opgaven, maar dat is dan verder niet an belang.
ErwinKomen commented 2 years ago

Translation

How do the desires above translate into actions in the importing process? B.t.w: remember how the importing goes: go to the /admin/dictionary/info/ table, make sure all input files are correctly identified there (including the Deel/Sectie/Aflevering numbering), and then start importing via the '0' part.

The import process starts with view import_csv_start() This then calls excel_to_fixture(), which converts the Excel file(s) into a fixture file

  1. Only accept an entry (into the online database) if the value for standaardspelling (that is, trefwoord_name) is available
    1. The physical reading of each entry is done using the class WgdProcessor, method partToLine()
    2. The contents of this line are checked via method isLineOkay()
      1. This checks the availability of all essential elements
      2. The value of trefwoord_name is one of the essential elements
      3. If that value is none or NULL or starts with # or some other checks: the whole entry is not taken up into the DB
  2. Add color for inwoordenboek - that was already solved in issue #45
  3. As for standaardspelling: copy this from the previous entry under the following circumstances:
    1. The current value for standaarspelling is empty
    2. The location is exactly the same as the previous one (e.g. Kloekecode F 103/2
    3. The lemma is the same as the previous one
ErwinKomen commented 2 years ago

Actions

  1. Added code in excel_to_fixture() that checks whether a trefwoord_name is empty, and if so, it checks if all other conditions are met to actually take it over from the previous entry