Skip to content

Commit

Permalink
🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
HerbertHe committed Apr 9, 2024
1 parent 3b021d9 commit 6e5957d
Show file tree
Hide file tree
Showing 8 changed files with 291 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*.yml]
tab_width = 2
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_size = 2
indent_style = space
39 changes: 39 additions & 0 deletions .github/workflows/generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Generator

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run : |
yarn install
pip3 install edge-tts --break-system-packages
- name: Generate voice
run: |
yarn gen
- name: "Jekyll theme"
run: mv ./_config.temp.yml ./dist/_config.yml

- name: Deploy github pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
enable_jekyll: true

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.venv

# Logs
logs
*.log
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# kazakh-character-voices

kazakh character voices
1 change: 1 addition & 0 deletions _config.temp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "kazakh-character-voices",
"version": "1.0.0",
"main": "index.js",
"type": "module",
"repository": "git@github.com:ha-pin/kazakh-character-voices.git",
"author": "HerbertHe <Herbert.He0229@gmail.com>",
"license": "GPL-3.0",
"scripts": {
"gen": "node scripts/index.js"
}
}
26 changes: 26 additions & 0 deletions scripts/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import fs from "fs"
import path from "path"
import { execSync } from "child_process"

const distPath = path.resolve("dist")
const charactersPath = path.join(distPath, "characters")
const charactersSourcesPath = path.resolve("sources", "characters.map.json")

const generator = () => {
if (!fs.existsSync(charactersPath)) {
fs.mkdirSync(charactersPath, { recursive: true })
}

JSON.parse(fs.readFileSync(charactersSourcesPath, "utf8")).forEach(
({ hapin, cyrillic }) => {
execSync(
`edge-tts --text ${cyrillic} --voice kk-KZ-DauletNeural --write-media ${path.join(
charactersPath,
`${hapin}.mp3`
)}`
)
}
)
}

generator()
202 changes: 202 additions & 0 deletions sources/characters.map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
[
{
"arabic": "ا",
"cyrillic": "а",
"hapin": "a"
},
{
"arabic": "ب",
"cyrillic": "б",
"hapin": "b"
},
{
"arabic": "د",
"cyrillic": "д",
"hapin": "d"
},
{
"arabic": "ى",
"cyrillic": "ы",
"hapin": "e"
},
{
"arabic": "ف",
"cyrillic": "ф",
"hapin": "f"
},
{
"arabic": "گ",
"cyrillic": "г",
"hapin": "g"
},
{
"arabic": "ح",
"cyrillic": "х",
"hapin": "h"
},
{
"arabic": "ي",
"cyrillic": "й",
"hapin": "i"
},
{
"arabic": "ج",
"cyrillic": "ж",
"hapin": "j"
},
{
"arabic": "ك",
"cyrillic": "к",
"hapin": "k"
},
{
"arabic": "ل",
"cyrillic": "л",
"hapin": "l"
},
{
"arabic": "م",
"cyrillic": "м",
"hapin": "m"
},
{
"arabic": "ن",
"cyrillic": "н",
"hapin": "n"
},
{
"arabic": "و",
"cyrillic": "о",
"hapin": "o"
},
{
"arabic": "پ",
"cyrillic": "п",
"hapin": "p"
},
{
"arabic": "ق",
"cyrillic": "қ",
"hapin": "q"
},
{
"arabic": "ر",
"cyrillic": "р",
"hapin": "r"
},
{
"arabic": "س",
"cyrillic": "с",
"hapin": "s"
},
{
"arabic": "ت",
"cyrillic": "т",
"hapin": "t"
},
{
"arabic": "ۇ",
"cyrillic": "ұ",
"hapin": "u"
},
{
"arabic": "ۆ",
"cyrillic": "в",
"hapin": "v"
},
{
"arabic": "ۋ",
"cyrillic": "у",
"hapin": "w"
},
{
"arabic": "ز",
"cyrillic": "з",
"hapin": "z"
},
{
"arabic": "ە",
"cyrillic": "е",
"hapin": "ye"
},
{
"arabic": "ع",
"cyrillic": "ғ",
"hapin": "gh"
},
{
"arabic": "ھ",
"cyrillic": "һ",
"hapin": "hh"
},
{
"arabic": "ڭ",
"cyrillic": "ң",
"hapin": "ng"
},
{
"arabic": "ش",
"cyrillic": "ш",
"hapin": "sh"
},
{
"arabic": "چ",
"cyrillic": "ч",
"hapin": "ch"
},
{
"arabic": "ٴا ",
"cyrillic": "ә",
"hapin": "xa"
},
{
"arabic": "ٴى ",
"cyrillic": "і",
"hapin": "xe"
},
{
"arabic": "ٴو",
"cyrillic": "ө",
"hapin": "xo"
},
{
"arabic": "ٴۇ",
"cyrillic": "ү",
"hapin": "xu"
},
{
"arabic": "ٴۇ",
"cyrillic": "ү",
"hapin": "yu"
},
{
"arabic": "يو",
"cyrillic": "ё",
"hapin": "yo"
},
{
"arabic": "ي",
"cyrillic": "и",
"hapin": "yi"
},
{
"arabic": "تس",
"cyrillic": "ц",
"hapin": "c"
},
{
"arabic": "يۋ",
"cyrillic": "ю",
"hapin": "yw"
},
{
"arabic": "يا",
"cyrillic": "я",
"hapin": "ya"
},
{
"arabic": "",
"cyrillic": "э",
"hapin": "yy"
}
]

0 comments on commit 6e5957d

Please sign in to comment.