-
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.
- Loading branch information
Showing
8 changed files
with
90 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Push test image to Docker Hub. | |
on: | ||
push: | ||
branch: | ||
- "main" | ||
- "test" | ||
|
||
env: | ||
DOCKER_USER: lcnetdev | ||
|
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/ibleaman/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 |
---|---|---|
|
@@ -7,3 +7,4 @@ python-dotenv>=1.0,<2 | |
pyyaml>=6.0,<7 | ||
repackage>=0.7.3 | ||
uwsgi>=2.0,<2.1 | ||
./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
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
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,21 @@ | ||
general: | ||
name: Yiddish | ||
|
||
options: | ||
- id: loshn_koydesh | ||
label: Loshn Koydesh | ||
description: [TODO] | ||
type: boolean | ||
default: false | ||
|
||
script_to_roman: | ||
hooks: | ||
post_config: | ||
- | ||
- yiddish_.s2r_post_config | ||
|
||
roman_to_script: | ||
hooks: | ||
post_config: | ||
- | ||
- yiddish_.r2s_post_config |