-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Yiddish transliteration via submodules. * Update checkout workflow. * Change refs for Yiddish submodules. * Fix WORKDIR in Dockerfile * Do not remove yiddish module. * Manually add yiddish submodules. * Use git clone instead of submodule. * Move ext checkout to github actions. * Chinese numerals (#97) * WIP Parse Chinese numerals. * WIP complete number parsing. * Complete Chinese numerals: * Use standard table override instead of pre-config hooks. * Add few test strings. * Complete numerals: * Transliterate all numeric examples correctly * Modify hook return logic for consistency * WIP partial spacing fix. * Some cleanup; upgrade docker OS. * Add dependency for uwsgi. * Squashed commit of the following: (#98) commit 30859a5 Author: scossu <[email protected]> Date: Wed Feb 28 22:17:36 2024 -0500 Move ext checkout to github actions. commit 6d8da6d Author: scossu <[email protected]> Date: Wed Feb 28 21:45:01 2024 -0500 Use git clone instead of submodule. commit ade9da5 Author: scossu <[email protected]> Date: Wed Feb 28 21:42:45 2024 -0500 Manually add yiddish submodules. commit 77cb9ef Author: scossu <[email protected]> Date: Wed Feb 28 21:23:37 2024 -0500 Do not remove yiddish module. commit e405b36 Author: scossu <[email protected]> Date: Wed Feb 28 09:11:41 2024 -0500 Fix WORKDIR in Dockerfile commit 95445ba Author: scossu <[email protected]> Date: Wed Feb 28 09:07:50 2024 -0500 Change refs for Yiddish submodules. commit 208ea09 Author: scossu <[email protected]> Date: Wed Feb 28 08:45:58 2024 -0500 Update checkout workflow. * Add debug output to /trans response. * Split docker files and requirements. * Add bad request debug handler. * Add bad request debug handler. * Adjust CI workflows. * Fix image name typo. * Refine triggers. * Fix typo on test workflow trigger. * Use JSON in POST body. * Also use JSON in feedback request; update docs. * Return json data in 400 debug.
- Loading branch information
Showing
16 changed files
with
268 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Push base image | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.0" | ||
|
||
env: | ||
DOCKER_USER: lcnetdev | ||
DOCKER_PASSWORD: ${{secrets.DOCKER_HUB}} | ||
REPO_NAME: scriptshifter-base | ||
|
||
jobs: | ||
push-image-to-docker-hub: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: checkout yiddish submodules (1/2) | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ibleaman/loshn-koydesh-pronunciation | ||
path: ext/yiddish/yiddish/submodules/loshn-koydesh-pronunciation | ||
|
||
- name: checkout yiddish submodules (2/2) | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ibleaman/hasidify_lexicon | ||
path: ext/yiddish/yiddish/submodules/hasidify_lexicon | ||
|
||
- name: Build the Docker image | ||
run: > | ||
docker build -f scriptshifter_base.Dockerfile . | ||
--tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }} | ||
--tag $DOCKER_USER/$REPO_NAME:latest | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: lcnetdev | ||
password: ${{ secrets.DOCKER_HUB }} | ||
|
||
- name: Push to Docker Hub | ||
run: docker push $DOCKER_USER/$REPO_NAME --all-tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
[submodule "ext/arabic_rom"] | ||
path = ext/arabic_rom | ||
url = https://github.com/fadhleryani/Arabic_ALA-LC_Romanization.git | ||
[submodule "ext/yiddish"] | ||
path = ext/yiddish | ||
url = https://github.com/scossu/yiddish.git | ||
branch = loc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# External dependencies. | ||
aksharamukha>=2.1,<3 | ||
camel-tools>=1.5 | ||
funcy>=1.15,<2 | ||
pymarc>=4.0,<5 | ||
repackage>=0.7.3 | ||
./ext/yiddish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
aksharamukha>=2.1,<3 | ||
camel-tools>=1.5 | ||
# Core application dependencies. | ||
flask>=2.3,<3 | ||
funcy>=1.15,<2 | ||
pymarc>=4.0,<5 | ||
python-dotenv>=1.0,<2 | ||
pyyaml>=6.0,<7 | ||
repackage>=0.7.3 | ||
uwsgi>=2.0,<2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# @package ext | ||
|
||
__doc__ = """ | ||
Yiddish transliteration module. | ||
Courtesy of Isaac Bleaman and Asher Lewis. | ||
https://github.com/ibleaman/yiddish.git | ||
Note the underscore in the module name to disambiguate with the `yiddish` | ||
external package name. | ||
""" | ||
|
||
|
||
from yiddish import detransliterate, transliterate | ||
|
||
from scriptshifter.exceptions import BREAK | ||
from scriptshifter.tools import capitalize | ||
|
||
|
||
def s2r_post_config(ctx): | ||
""" | ||
Script to Roman. | ||
""" | ||
|
||
rom = transliterate( | ||
ctx.src, loc=True, | ||
loshn_koydesh=ctx.options.get("loshn_koydesh")) | ||
|
||
if ctx.options["capitalize"] == "all": | ||
rom = capitalize(rom) | ||
elif ctx.options["capitalize"] == "first": | ||
rom = rom[0].upper() + rom[1:] | ||
|
||
ctx.dest = rom | ||
|
||
return BREAK | ||
|
||
|
||
def r2s_post_config(ctx): | ||
""" | ||
Roman to script. | ||
NOTE: This doesn't support the `loc` option. | ||
""" | ||
|
||
ctx.dest = detransliterate( | ||
ctx.src, | ||
loshn_koydesh=ctx.options.get("loshn_koydesh")) | ||
|
||
return BREAK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.