diff options
author | polwex <polwex@sortug.com> | 2025-05-29 15:37:22 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-05-29 15:37:22 +0700 |
commit | f23f7d2f0106882183929c740e4862a1939900d0 (patch) | |
tree | 8f77b63ca7e65db828e3bada68d54513acfea777 /src/lib/db/seed.ts | |
parent | 8e0965f5274635f609972ef85802675af64df0f4 (diff) |
me again but it works!
Diffstat (limited to 'src/lib/db/seed.ts')
-rw-r--r-- | src/lib/db/seed.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/db/seed.ts b/src/lib/db/seed.ts index 6c2a9f7..b776782 100644 --- a/src/lib/db/seed.ts +++ b/src/lib/db/seed.ts @@ -276,6 +276,7 @@ async function fillFromDump() { for await (const line of readWiktionaryDump()) { try { count++; + console.log({ count }); // if (count > 80) break; // if (line.length > biggest) { // biggest = line.length; @@ -522,7 +523,7 @@ async function redump() { count++; // if (count > 50) break; const j = JSON.parse(line); - console.log(Object.keys(j), j.word); + // console.log(Object.keys(j), j.word); // add language to db pdb.addLanguage(j.lang_code, j.lang); if (!langs.includes(j.lang_code)) continue; @@ -534,7 +535,7 @@ async function redump() { if (isWord) await handleWord(j); else await handleIdiom(j); } catch (e) { - console.log("error parsing", e); + // console.log("error parsing", e); // break; } } @@ -555,11 +556,11 @@ type SorSyl = { async function handleWord(j: any) { let ts = Date.now(); const analyzed = await findLemma(j.word, j.lang_code); - console.log(analyzed.segments.length); + // console.log(analyzed.segments.length); if (analyzed.segments.length !== 1) return console.error("wtf bruh", analyzed); const seg = analyzed.segments[0]; - if (!seg) console.log("no seg", analyzed); + if (!seg) return console.log("no seg", analyzed); const isLemma = analyzed.input === seg.root.lemma; if (!isLemma) // return console.error("not lemma", { @@ -608,7 +609,7 @@ async function handleIpa( else return `${acc}${item.ipa}`; }, ""); if (wordRhyme) pdb.addWordRhyme(wordId, wordRhyme, j.lang_code, wikiRhyme); - else console.log("no rhyme?", hjon); + // else console.log("no rhyme?", hjon); for (const syl of hjon.syls) { // TODO ideally syllables would have spelling not IPA... harsh tho pdb.addSyllable( @@ -628,8 +629,8 @@ async function handleIpa( // console.log(Date.now() - ts, "elapsed in db"); // ts = Date.now(); } catch (e) { - console.error(e); - console.error({ snd }); + // console.error(e); + // console.error({ snd }); // break; } } |