-
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.
Add Arabic transliteration via 3d party.
- Loading branch information
Showing
10 changed files
with
49 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "ext/arabic_transliterator"] | ||
path = ext/arabic_transliterator | ||
url = [email protected]:MTG/ArabicTransliterator.git |
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
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
Submodule arabic_transliterator
added at
df0296
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,22 @@ | ||
import logging | ||
|
||
# This requires ArabicTransliterator to be installed as a package. | ||
from arabic.ArabicTransliterator import ALA_LC_Transliterator as Trans | ||
from mishkal.tashkeel.tashkeel import TashkeelClass | ||
|
||
from scriptshifter.exceptions import BREAK | ||
|
||
|
||
__doc__ = """ Integrate external ArabicTransliterator library. """ | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def s2r_post_config(ctx): | ||
trans = Trans() | ||
vocalizer = TashkeelClass() | ||
voc = vocalizer.tashkeel(ctx.src) | ||
ctx.dest = trans.do(voc.strip()) | ||
|
||
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,12 @@ | ||
# Arabic S2R using the 3rd-party ArabicTransliterator library: | ||
# https://github.com/MTG/ArabicTransliterator | ||
|
||
general: | ||
name: Arabic (ArabicTransliterator) | ||
description: Arabic S2R using a 3rd party library. | ||
|
||
script_to_roman: | ||
hooks: | ||
post_config: | ||
- | ||
- arabic_ext.s2r_post_config |
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