Repository navigation
Conversation
|
phonemes: ══ Failed ══════════════════════════════════════════════════════════════════════ A tibble: 50 × 2Phonemes InventoryIDs ══ DONE ════════════════════════════════════════════════════════════════════════ |
f098ba6 to
c5c558c
Compare
|
phonemes: ══ Failed ══════════════════════════════════════════════════════════════════════ A tibble: 50 × 2Phonemes InventoryIDs ══ DONE ════════════════════════════════════════════════════════════════════════ |
|
phonemes: ══ Failed ══════════════════════════════════════════════════════════════════════ A tibble: 50 × 2Phonemes InventoryIDs ══ DONE ════════════════════════════════════════════════════════════════════════ |
Adds generate-inventory-ids.R and sync-inventory-ids.R.
Updates all references to the current IDs (called Legacy here) to new IDs in mapping files, raw-data, phoible.csv
Updates tests to read inventoryIDs as characters, hardcoded legacy IDs changed to new IDs.
Modified aggregate-raw-data to add a method of retiring inventories through soft delete
generate-inventory-ids.R - New IDs are character strings of the format "pXXXXX" where XXXXX is a 5 digit hexadecimal number generated through multiplicative hashing. This ensures deterministic ID generation (so no random generation and retry issues) and it is non-sequential.
The p (for phoible) is to ensure the new IDs throw an error if any old code reads it as an integer, and 5 digits to differentiate it from the 4 digit ID before. This should reduce instances of people confusing the new IDs for an older integer ID due to similarity (eg, p1200 could be mistaken to be same as 1200 from the old IDs)
sync-inventory-ids.R - Script to go through each source and generate and bake in hex InventoryIDs. Code exists so that we can add new inventories easily without manually having to bake in the InventoryIDs like before.
Soft delete inventories - mapping/InventoryID-Retired.csv can be used to retire inventories without modifying them in raw-data. Declaring an ID in the csv will automatically exclude it from the final phoible.csv in aggregate-raw-data.R
New mapping files - InventoryID-Legacy.csv maps the current (Legacy) IDs to the new hex IDs. Rest of the mapping files now use the new IDs.
Tests - tests updated to read IDs as character strings. Hardcoded entries of integer IDs updated to the hex IDs.
@drammock Let me know if there's any issue with any of the above parts.
Defer merging until #420 is merged, I will rebase the code to have the updated ISOCodes here.NOTE: Will need to create an issue on the CLDF side to redirect pages with old IDs to the newer ones.