Skip to content

Commit

Permalink
DATA: Convert Base Category
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhieb committed Jun 10, 2024
1 parent 4f5d1e0 commit 74400dc
Show file tree
Hide file tree
Showing 23 changed files with 670 additions and 630 deletions.
40 changes: 40 additions & 0 deletions data/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,39 @@ function cleanUR(UR) {
.replace(/\/$/v, ``)
}

function groupColumns(record, ...colTypes) {

const keys = Object.keys(record)
const items = []

for (const colType of colTypes) {

const letteredColumns = keys.filter(key => key.startsWith(colType))

for (const letteredColumn of letteredColumns) {

const [, letter] = letteredColumn.split(`-`)
const i = letterToIndex(letter)
const data = record[letteredColumn]

if (data) {
items[i] ??= {}
const item = items.at(i)
item[colType] = data
}

}

}

return items

}

function letterToIndex(letter) {
return letter.toLowerCase().charCodeAt(0) - 97
}

export default class Components extends Map {

static columns = {
Expand Down Expand Up @@ -228,6 +261,13 @@ export default class Components extends Map {

}


// Base Category
if (component.secondary) {
component.baseCategories = groupColumns(record, cols.baseCategory)
.map(({ [cols.baseCategory]: baseCategory }) => baseCategory)
}

// Matches
component.matches = {
AI: record[cols.matchAI],
Expand Down
8 changes: 4 additions & 4 deletions data/json/components/Abenaki_Eastern.ndjson
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{"componentID":"8","ID":"Abenaki_Eastern-8","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-at","UR":"","PA":"","definition":"","type":"final","subcategory":"II","reduplicated":false,"specificity":"","primary":true,"secondary":false,"matches":{"AI":"-əsi","II":"","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 337","form":"-at","gloss":"state, shape, condition, or essence, middle reflexive","PA":"","UR":""}]}
{"componentID":"9","ID":"Abenaki_Eastern-9","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-elə-","UR":"","PA":"","definition":"","type":"medial","subcategory":"","reduplicated":false,"specificity":"","matches":{"AI":"","II":"","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 336","form":"-elə-","gloss":"mental process","PA":"","UR":""}]}
{"componentID":"10","ID":"Abenaki_Eastern-10","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-əkw-","UR":"","PA":"","definition":"","type":"postmedial","subcategory":"","reduplicated":false,"specificity":"","matches":{"AI":"","II":"","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 336, 337, 341","form":"-əkʷ-","gloss":"subject to the act","PA":"","UR":""}]}
{"componentID":"11","ID":"Abenaki_Eastern-11","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-əsi","UR":"","PA":"","definition":"","type":"final","subcategory":"AI","reduplicated":false,"specificity":"","primary":true,"secondary":true,"matches":{"AI":"","II":"-əte","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 334, 336, 337, 338, 341","form":"-əsi","gloss":"reflexive","PA":"","UR":""}]}
{"componentID":"11","ID":"Abenaki_Eastern-11","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-əsi","UR":"","PA":"","definition":"","type":"final","subcategory":"AI","reduplicated":false,"specificity":"","primary":true,"secondary":true,"baseCategories":["TA"],"matches":{"AI":"","II":"-əte","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 334, 336, 337, 338, 341","form":"-əsi","gloss":"reflexive","PA":"","UR":""}]}
{"componentID":"12","ID":"Abenaki_Eastern-12","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-əsi","UR":"","PA":"","definition":"","type":"final","subcategory":"AI","reduplicated":false,"specificity":"","primary":true,"secondary":false,"matches":{"AI":"","II":"-at","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 337","form":"-əsi","gloss":"state, shape, condition, or essence, middle reflexive","PA":"","UR":""}]}
{"componentID":"13","ID":"Abenaki_Eastern-13","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-əsi","UR":"","PA":"","definition":"","type":"final","subcategory":"AI","reduplicated":false,"specificity":"","primary":true,"secondary":false,"matches":{"AI":"","II":"-te","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 339","form":"-əsi","gloss":"inactive condition or state, middle reflexive","PA":"","UR":""}]}
{"componentID":"14","ID":"Abenaki_Eastern-14","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-əsw-","UR":"","PA":"","definition":"","type":"final","subcategory":"TA","reduplicated":false,"specificity":"","primary":true,"secondary":false,"matches":{"AI":"","II":"","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 334","form":"-əsw-","gloss":"by cutting edge","PA":"","UR":""}]}
Expand Down Expand Up @@ -36,9 +36,9 @@
{"componentID":"36","ID":"Abenaki_Eastern-36","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αm-","UR":"","PA":"","definition":"","type":"medial","subcategory":"","reduplicated":false,"specificity":"","matches":{"AI":"","II":"","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 336","form":"-αm-","gloss":"fine particles, sand","PA":"","UR":""}]}
{"componentID":"37","ID":"Abenaki_Eastern-37","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αməkwiha-","UR":"","PA":"","definition":"","type":"prefinal","subcategory":"","reduplicated":false,"specificity":"","matches":{"AI":"","II":"","TA":"","TI":""},"deverbal":false,"notes":"complex prefinal","tokens":[{"bibliography":"FS_PS1983: 336","form":"-αməkwiha-","gloss":"storm, squall","PA":"","UR":""}]}
{"componentID":"38","ID":"Abenaki_Eastern-38","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αməkwihasi","UR":"","PA":"","definition":"","type":"final","subcategory":"II","reduplicated":false,"specificity":"","primary":true,"secondary":false,"matches":{"AI":"","II":"","TA":"","TI":""},"deverbal":false,"notes":"MAM: combines with -əsi; I deduced the combination from examples. On p. 337 he writes as -αməkwihaso; I think this is an error.","tokens":[{"bibliography":"FS_PS1983: 336, 337","form":"-αməkwihasi","gloss":"storm, squall, middle reflexive","PA":"","UR":""}]}
{"componentID":"39","ID":"Abenaki_Eastern-39","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αsi","UR":"","PA":"","definition":"reflexive of useful action","type":"final","subcategory":"II","reduplicated":false,"specificity":"","primary":false,"secondary":true,"matches":{"AI":"-αsi","II":"","TA":"","TI":""},"deverbal":false,"notes":"MAM: \"classified as middle reflexives in Penobscot because of the derivational processes involved\"","tokens":[{"bibliography":"FS_PS1983: 341","form":"-αsi","gloss":"of purposeful action, middle reflexive","PA":"","UR":""}]}
{"componentID":"40","ID":"Abenaki_Eastern-40","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αsi","UR":"","PA":"","definition":"reflexive of useful action","type":"final","subcategory":"AI","reduplicated":false,"specificity":"","primary":false,"secondary":true,"matches":{"AI":"","II":"-αsi","TA":"","TI":""},"deverbal":false,"notes":"MAM: \"classified as middle reflexives in Penobscot because of the derivational processes involved\"","tokens":[{"bibliography":"FS_PS1983: 341","form":"-αsi","gloss":"of purposeful action, middle reflexive","PA":"","UR":""}]}
{"componentID":"41","ID":"Abenaki_Eastern-41","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αso","UR":"","PA":"","definition":"","type":"final","subcategory":"II","reduplicated":false,"specificity":"","primary":false,"secondary":true,"matches":{"AI":"-αso","II":"","TA":"","TI":""},"deverbal":false,"notes":"MAM: S&S say base is TI2 but then say it has extended to other TI stems; given the other forms in this article, I think this might be an error for -αsi. And he gives -αsi on p. 341, defined as 'of purposeful action, passive reflexive [middle reflexive?]. I've entered them separately but suspect they are the same.","tokens":[{"bibliography":"FS_PS1983: 335","form":"-αso","gloss":"passive reflexive","PA":"","UR":""}]}
{"componentID":"39","ID":"Abenaki_Eastern-39","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αsi","UR":"","PA":"","definition":"reflexive of useful action","type":"final","subcategory":"II","reduplicated":false,"specificity":"","primary":false,"secondary":true,"baseCategories":["TI"],"matches":{"AI":"-αsi","II":"","TA":"","TI":""},"deverbal":false,"notes":"MAM: \"classified as middle reflexives in Penobscot because of the derivational processes involved\"","tokens":[{"bibliography":"FS_PS1983: 341","form":"-αsi","gloss":"of purposeful action, middle reflexive","PA":"","UR":""}]}
{"componentID":"40","ID":"Abenaki_Eastern-40","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αsi","UR":"","PA":"","definition":"reflexive of useful action","type":"final","subcategory":"AI","reduplicated":false,"specificity":"","primary":false,"secondary":true,"baseCategories":["TI"],"matches":{"AI":"","II":"-αsi","TA":"","TI":""},"deverbal":false,"notes":"MAM: \"classified as middle reflexives in Penobscot because of the derivational processes involved\"","tokens":[{"bibliography":"FS_PS1983: 341","form":"-αsi","gloss":"of purposeful action, middle reflexive","PA":"","UR":""}]}
{"componentID":"41","ID":"Abenaki_Eastern-41","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αso","UR":"","PA":"","definition":"","type":"final","subcategory":"II","reduplicated":false,"specificity":"","primary":false,"secondary":true,"baseCategories":["TI"],"matches":{"AI":"-αso","II":"","TA":"","TI":""},"deverbal":false,"notes":"MAM: S&S say base is TI2 but then say it has extended to other TI stems; given the other forms in this article, I think this might be an error for -αsi. And he gives -αsi on p. 341, defined as 'of purposeful action, passive reflexive [middle reflexive?]. I've entered them separately but suspect they are the same.","tokens":[{"bibliography":"FS_PS1983: 335","form":"-αso","gloss":"passive reflexive","PA":"","UR":""}]}
{"componentID":"42","ID":"Abenaki_Eastern-42","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"-αso","UR":"","PA":"","definition":"","type":"final","subcategory":"AI","reduplicated":false,"specificity":"","primary":true,"secondary":false,"matches":{"AI":"","II":"-αso","TA":"","TI":""},"deverbal":false,"notes":"MAM: S&S say base is TI2 but then say it has extended to other TI stems; given the other forms in this article, I think this might be an error for -αsi. And he gives -αsi on p. 341, defined as 'of purposeful action, passive reflexive [middle reflexive?]. I've entered them separately but suspect they are the same.","tokens":[{"bibliography":"FS_PS1983: 335","form":"-αso","gloss":"passive reflexive","PA":"","UR":""}]}
{"componentID":"43","ID":"Abenaki_Eastern-43","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"aki-","UR":"","PA":"","definition":"","type":"initial","subcategory":"","reduplicated":false,"specificity":"","matches":{"AI":"","II":"","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 338","form":"aki-","gloss":"count","PA":"","UR":""}]}
{"componentID":"44","ID":"Abenaki_Eastern-44","language":"Abenaki_Eastern","displayLanguage":"Eastern Abenaki","dialect":"Penobscot","Glottocode":"peno1243","ISO":"aaq","form":"akit-","UR":"","PA":"","definition":"","type":"final","subcategory":"II","reduplicated":false,"specificity":"ABSTR","primary":true,"secondary":false,"matches":{"AI":"","II":"","TA":"","TI":""},"deverbal":false,"notes":"","tokens":[{"bibliography":"FS_PS1983: 336","form":"akit-","gloss":"","PA":"","UR":""}]}
Expand Down
Loading

0 comments on commit 74400dc

Please sign in to comment.