Skip to content

Commit

Permalink
DATA: Pull latest data from Google Sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhieb committed Jun 6, 2024
1 parent 815a5c8 commit 95532f1
Show file tree
Hide file tree
Showing 10 changed files with 1,865 additions and 1,864 deletions.
8 changes: 7 additions & 1 deletion data/Components.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { appendFile } from 'node:fs/promises'
import Issues from './Issues.js'
import ndjson from '../database/NDJSON.js'
import Orthographies from './Orthographies.js'
Expand Down Expand Up @@ -71,11 +72,16 @@ export default class Components extends Map {
this.language = language
}

convert(componentsCSV, tokensCSV) {
async convert(componentsCSV, tokensCSV) {

const componentRecords = parseCSV(componentsCSV, Components.csvOptions)
const tokenRecords = parseCSV(tokensCSV, Components.csvOptions)

if (componentRecords.length === tokenRecords.length) {
const susPath = path.resolve(import.meta.dirname, `./sus.txt`)
await appendFile(susPath, `${ this.language }\n`, `utf8`)
}

const records = new Map
const cols = Components.columns

Expand Down
4 changes: 2 additions & 2 deletions data/DataManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class DataManager {
const componentsCSV = await readFile(componentsPath, `utf8`)
const tokensCSV = await readFile(tokensPath, `utf8`)

components.convert(componentsCSV, tokensCSV)
await components.convert(componentsCSV, tokensCSV)

await components.save()

Expand Down Expand Up @@ -93,7 +93,7 @@ export default class DataManager {
*/
async fetchAllComponents() {

if (!this.languages) await this.loadLanguages()
await this.languages.load()

const progressBar = new ProgressBar(`:bar`, {
total: this.languages.size,
Expand Down
787 changes: 393 additions & 394 deletions data/csv/Cree_Innu/components.csv

Large diffs are not rendered by default.

846 changes: 423 additions & 423 deletions data/csv/Cree_Innu/tokens.csv

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion data/csv/Cree_Moose_Swampy/components.csv
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ ID,Author Surname,Source Code,Page #,ISO code,Dialect,Glottocode,Form (original
37,Ellis,CDE2000,249,"crm, csw",,"moos1236, swam1239",milo,C-M:1,,,,,,"good, fine",,initial
38,Ellis,CDE2000,247,"crm, csw",,"moos1236, swam1239",nah,C-M:1,,,,,,NG,,initial
39,Ellis,CDE2000,248,"crm, csw",,"moos1236, swam1239",naka,C-M:1,,,,,,NG,,initial
40,Ellis,CDE2000,249,"crm, csw",,"moos1236, swam1239","nân'taw, nanâtaw",C-M:1,,,,,,"tend to, seek to",,initial,,Y
41,Ellis,CDE2000,200,"crm, csw",,"moos1236, swam1239",nataw,C-M:1,,,,,,"tend to, seek to",,initial,,,,,,,,,,,,natawâpaht-,,,V,TI,NG,,,,,,,,,,,,,,,,stem source not checked - no pdf
42,Ellis,CDE2000,248,"crm, csw",,"moos1236, swam1239",oši,C-M:1,,,,,,NG,,initial
43,Ellis,CDE2000,247,"crm, csw",,"moos1236, swam1239",ot,C-M:1,,,,,,NG,,initial
Expand Down
2 changes: 1 addition & 1 deletion data/csv/Cree_Moose_Swampy/tokens.csv
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Component ID,Author Surname,Source Code,Page #,ISO code,Dialect,Glottocode,Form
37,Ellis,CDE2000,249,"crm, csw",,"moos1236, swam1239",milo,C-M:1,,,,,,"good, fine",,initial
38,Ellis,CDE2000,247,"crm, csw",,"moos1236, swam1239",nah,C-M:1,,,,,,NG,,initial
39,Ellis,CDE2000,248,"crm, csw",,"moos1236, swam1239",naka,C-M:1,,,,,,NG,,initial
40,Ellis,CDE2000,249,"crm, csw",,"moos1236, swam1239","nân'taw, nanâtaw",C-M:1,,,,,,"tend to, seek to",,initial,,Y
41,Ellis,CDE2000,249,"crm, csw",,"moos1236, swam1239","nân'taw, nanâtaw",C-M:1,,,,,,"tend to, seek to",,initial,,Y
41,Ellis,CDE2000,200,"crm, csw",,"moos1236, swam1239",nataw,C-M:1,,,,,,"tend to, seek to",,initial,,,,,,,,,,,,natawâpaht-,,,V,TI,NG,,,,,,,,,,,,,,,,stem source not checked - no pdf
42,Ellis,CDE2000,248,"crm, csw",,"moos1236, swam1239",oši,C-M:1,,,,,,NG,,initial
43,Ellis,CDE2000,247,"crm, csw",,"moos1236, swam1239",ot,C-M:1,,,,,,NG,,initial
Expand Down
98 changes: 49 additions & 49 deletions data/csv/Cree_Plains/tokens.csv

Large diffs are not rendered by default.

632 changes: 316 additions & 316 deletions data/csv/Meskwaki/components.csv

Large diffs are not rendered by default.

1,117 changes: 557 additions & 560 deletions data/csv/Meskwaki/tokens.csv

Large diffs are not rendered by default.

234 changes: 117 additions & 117 deletions data/csv/Proto_Algonquian/tokens.csv

Large diffs are not rendered by default.

0 comments on commit 95532f1

Please sign in to comment.