Skip to content

Commit

Permalink
improve word generator script and expand first lesson
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcapJake committed Feb 5, 2024
1 parent 35016b8 commit d00ed50
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .vscode/words.code-snippets

Large diffs are not rendered by default.

37 changes: 22 additions & 15 deletions docs/lessons/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ possible (and a little extra to the underdogs). Additionally, there are now
a few words that you are already familiar with from your first language that
should give you a small anchor point for learning the language.

:::caution
:::caution Not Your Native Language

While words are being taken from languages it is important to remember that this
language is not your native language, you will need to abandon any other rules
or word changes that you might normally make. The word can be used as a noun,
verb, or modifier so there's a good chance it will be used in a way that seems
wrong to your native language's grammar.

This is okay. Try to focus on the essence of that native language word, imagine
**This is okay.** Try to focus on the essence of that native language word, imagine
it being translated as the other parts of speech. Now think of the Hisyëö word
as covering all of these words. This is why we include all of the different
derivation translations in each definition, so that you can familiarize yourself
with all the ways it can be utilized. This is just at a most basic level too,
because when you start making compound phrases including these words, the
meaning now must be interpreted in terms of the head noun's essence or in terms
of the head verb's activity.
with all the ways it can be utilized. In fact, the provided descriptions are
just at the basic level because when you start making compound phrases including
these words, the meaning now must be interpreted in terms of the head noun's
essence or in terms of the head verb's activity.

:::

Expand All @@ -47,15 +47,22 @@ as interjections or greetings. Learning these will make it much easier to engage
in polite conversation and get your feet wet so as to begin the immersion
training.

The following are some of the current established expressions that act as
complete sentences:
> %%voxo|voxo%% (*vah*-shah) (shoot!) (woah!)
>
> %%mo|mo%% %%küu|küu%% %%lö|lö%% %%löizök|löizök%% (mah *koo*-wuh loh *loy*-choke) (Let's go!)
>
> %%nimö|nimö%% %%lı|lı%% %%gö|gö%% %%ëno|ëno%% (*nee*-moh lih goh *ay*-nah) (How are you doing?)
>
> %%uyö|uyö%% %%lı|lı%% %%yök|yök%% %%sonkon|sonkon%% (*uh*-yoh lih yoke *san*-kan) (It doesn't matter.)
:::info Examples

The following are some of the current established expressions that Hisyëans use
in day-to-day conversation:
- %%voxo|voxo%% (*vah*-shah) (shoot!) (woah!)
- %%mo|mo%% %%küu|küu%% %%lö|lö%% %%löizök|löizök%% (mah *koo*-wuh loh *loy*-choke) (Let's go!)
- %%nimö|nimö%% %%lı|lı%% %%gö|gö%% %%ëno|ëno%% (*nee*-moh lih goh *ay*-nah) (How are you doing?)
- %%uyö|uyö%% %%lı|lı%% %%yök|yök%% %%sonkon|sonkon%% (*uh*-yoh lih yoke *san*-kan) (It doesn't matter.)
- ...%%zi|zi%% (chee) (...agree?)
- %%löizök|löizök%% (*loy*-choke) (definitely!)
- %%lı|lı%% %%yünlön|yünlön%% %%zö|zö%% %%noyo|noyo%% (lih *yoon*-lan choh *nah*-yah) (Sorry!)
- %%küu|küu%% %%yök|yök%% %%zinȷon|zinȷon%% (Don't worry!)
- %%lı|lı%% %%yök|yök%% %%yëllë|yëllë%% (It's not a problem.)
- %%noyo|noyo%% %%kui|kui%% %%gö|gö%% %%hoi|hoi%% %%limien|limien%% %%ko|ko%% (Can I come in?)

:::

## Pronunciation

Expand Down
66 changes: 36 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@lunaticmuch/docusaurus-terminology": "^1.2.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"csv": "^6.3.6",
"neat-csv": "^7.0.0",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
67 changes: 29 additions & 38 deletions scripts/build.zx.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { parse } from 'csv-parse';

const file = await fs.readFile('./static/words.csv', 'utf8')
import csv from 'neat-csv';

const words = []

const parser = parse({
delimiter: ',',
columns: true,
})

const snippets = {}
const template = (w) => `---
id: ${w['Hisyëö']}
title: ${w['Hisyëö']}
Expand All @@ -28,43 +21,41 @@ ${w['Origin']} ${w['IPA']}
*${w['Family']} Language Family*`

console.log('Clearing existing files...')

const existingFiles = await glob(['./docs/words/**/*.md', './docs/words/**/*.mdx'])
try {
await $`rm ${existingFiles}`
console.log('Cleared existing files!')
} catch (err) {
console.error(err)
}

const snippets = {}

parser.on('readable', async () => {
console.log('Saturating markdown templates...')
let record; while ((record = parser.read()) !== null) {
try {
await fs.outputFile(`./docs/words/${record['Hisyëö'][0]}/${record['Hisyëö']}.md`, template(record))
snippets[record['Hisyëö']] = {
scope: "markdown",
prefix: record['Hisyëö'],
body: `%%${record['Hisyëö']}|${record['Hisyëö']}%%`,
description: record['Meaning']
}
} catch (err) {
console.error(err)
}
}
console.log('Parsing csv...')
const file = await fs.readFile('./static/words.csv', 'utf8')
const records = await csv(file, {
delimiter: ',',
columns: true,
})
parser.on('error', err => { console.error(err.message) })
parser.on('end', async () => {

process.stdout.write(`Outputting word files...`)
for (let data of records) {
try {
await fs.outputFile(`./.vscode/words.code-snippets`, JSON.stringify(snippets))
process.stdout.write(`.`)
await fs.outputFile(`./docs/words/${data['Hisyëö'][0]}/${data['Hisyëö']}.md`, template(data))
snippets[data['Hisyëö']] = {
scope: "markdown",
prefix: data['Hisyëö'],
body: `%%${data['Hisyëö']}|${data['Hisyëö']}%%`,
description: data['Meaning']
}
} catch (err) {
console.error(err)
}
console.log('Done!')
})
}
console.log('')

console.log(`Outputting snippets file...`)
try {
await $`rm ${existingFiles}`
console.log('Cleared existing files!')
await fs.outputFile(`./.vscode/words.code-snippets`, JSON.stringify(snippets))
} catch (err) {
console.error(err)
}

parser.write(file)
parser.end()
}

0 comments on commit d00ed50

Please sign in to comment.