diff --git a/scriptshifter/hooks/aksharamukha/romanizer.py b/scriptshifter/hooks/aksharamukha/romanizer.py index 4365199..b3998b7 100644 --- a/scriptshifter/hooks/aksharamukha/romanizer.py +++ b/scriptshifter/hooks/aksharamukha/romanizer.py @@ -15,16 +15,22 @@ logger = getLogger(__name__) -def s2r_post_config(ctx, src_script): +def s2r_post_config(ctx, src_script, pre=[], post=[]): # options = detect_preoptions(ctx.src, src_script) - options = [n for n, v in ctx.options.items() if v and n != "capitalize"] - ctx.dest = process(src_script, "IAST", ctx.src, pre_options=options) + pre_options = pre + [ + n for n, v in ctx.options.items() if v and n != "capitalize"] + ctx.dest = process( + src_script, "RomanLoC", ctx.src, + pre_options=pre_options, post_options=post) return BREAK -def r2s_post_config(ctx, dest_script): - options = [n for n, v in ctx.options.items() if v and n != "capitalize"] - ctx.dest = process("IAST", dest_script, ctx.src, post_options=options) +def r2s_post_config(ctx, dest_script, pre=[], post=[]): + post_options = post + [ + n for n, v in ctx.options.items() if v and n != "capitalize"] + ctx.dest = process( + "RomanLoC", dest_script, ctx.src, + pre_options=pre, post_options=post_options) return BREAK diff --git a/scriptshifter/tables/data/gujarati.yml b/scriptshifter/tables/data/gujarati.yml new file mode 100644 index 0000000..e72278e --- /dev/null +++ b/scriptshifter/tables/data/gujarati.yml @@ -0,0 +1,16 @@ +general: + name: Gujarati + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Gujarati" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Gujarati" diff --git a/scriptshifter/tables/data/index.yml b/scriptshifter/tables/data/index.yml index 889ba8f..99aa976 100644 --- a/scriptshifter/tables/data/index.yml +++ b/scriptshifter/tables/data/index.yml @@ -58,6 +58,8 @@ greek_classical: name: Greek (classical) greek_modern: name: Greek (modern) +gujarati: + name: Gujarati hebrew: name: Hebrew hindi: @@ -68,6 +70,8 @@ katakana: name: Japanese (Katakana) kalmyk_cyrillic: name: Kalmyk (Cyrillic) +kannada: + name: Kannada kara-kalpak_cyrillic: name: Kara-Kalpak (Cyrillic) karachai-balkar_cyrillic: @@ -80,6 +84,8 @@ khakass_cyrillic: name: Khakass (Cyrillic) khanty_cyrillic: name: Khanty (Cyrillic) +khmer: + name: Khmer komi_cyrillic: name: Komi (Cyrillic) korean_nonames: @@ -96,8 +102,12 @@ lithuanian_cyrillic: name: Lithuanian (Cyrillic) macedonian: name: Macedonian +marathi: + name: Marathi (Devanagari) mansi_cyrillic: name: Mansi (Cyrillic) +malayalam: + name: Malayalam moldovan_cyrillic: name: Moldovan (Cyrillic) mongolian_cyrillic: @@ -108,8 +118,16 @@ mordvin_cyrillic: name: Mordvin (Cyrillic) nenets_cyrillic: name: Nenets (Cyrillic) +oriya: + name: Oriya ossetic_cyrillic: name: Ossetic (Cyrillic) +pali: + name: Pali +panjabi: + name: Panjabi +prakrit: + name: Prakrit (Devanagari) pulaar: name: Pulaar (Adlam) gurmukhi: @@ -118,10 +136,14 @@ romani_cyrillic: name: Romani (Cyrillic) russian: name: Russian +sanskrit: + name: Sanskrit (Devanagari) serbian: name: Serbian shor_cyrillic: name: Shor (Cyrillic) +sinhalese: + name: Sinhalese syriac_cyrillic: name: Syriac (Cyrillic) tajik_cyrillic: @@ -132,6 +154,8 @@ tamil_brahmi: name: Tamil Brahmi tamil_extended: name: Tamil (extended) +telugu: + name: Telugu thai: name: Thai tatar-kryashen_cyrillic: diff --git a/scriptshifter/tables/data/kannada.yml b/scriptshifter/tables/data/kannada.yml new file mode 100644 index 0000000..4b60a29 --- /dev/null +++ b/scriptshifter/tables/data/kannada.yml @@ -0,0 +1,16 @@ +general: + name: Kannada + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Kannada" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Kannada" diff --git a/scriptshifter/tables/data/khmer.yml b/scriptshifter/tables/data/khmer.yml new file mode 100644 index 0000000..48ff6f6 --- /dev/null +++ b/scriptshifter/tables/data/khmer.yml @@ -0,0 +1,16 @@ +general: + name: Khmer + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Khmer" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Khmer" diff --git a/scriptshifter/tables/data/malayalam.yml b/scriptshifter/tables/data/malayalam.yml new file mode 100644 index 0000000..48ff6f6 --- /dev/null +++ b/scriptshifter/tables/data/malayalam.yml @@ -0,0 +1,16 @@ +general: + name: Khmer + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Khmer" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Khmer" diff --git a/scriptshifter/tables/data/marathi.yml b/scriptshifter/tables/data/marathi.yml new file mode 100644 index 0000000..5e99971 --- /dev/null +++ b/scriptshifter/tables/data/marathi.yml @@ -0,0 +1,18 @@ +general: + name: Marathi (Devanagari) + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Devanagari" + - post: ["HindiMarathiRomanLoCFix"] + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Devanagari" + - pre: ["HindiMarathiRomanLoCFix"] diff --git a/scriptshifter/tables/data/oriya.yml b/scriptshifter/tables/data/oriya.yml new file mode 100644 index 0000000..a3a911e --- /dev/null +++ b/scriptshifter/tables/data/oriya.yml @@ -0,0 +1,16 @@ +general: + name: Oriya + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Oriya" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Oriya" diff --git a/scriptshifter/tables/data/pali.yml b/scriptshifter/tables/data/pali.yml new file mode 100644 index 0000000..41462f4 --- /dev/null +++ b/scriptshifter/tables/data/pali.yml @@ -0,0 +1,16 @@ +general: + name: Pali + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Pali" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Pali" diff --git a/scriptshifter/tables/data/panjabi.yml b/scriptshifter/tables/data/panjabi.yml new file mode 100644 index 0000000..fbfe500 --- /dev/null +++ b/scriptshifter/tables/data/panjabi.yml @@ -0,0 +1,16 @@ +general: + name: Panjabi + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Punjabi" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Punjabi" diff --git a/scriptshifter/tables/data/prakrit.yml b/scriptshifter/tables/data/prakrit.yml new file mode 100644 index 0000000..89bac9f --- /dev/null +++ b/scriptshifter/tables/data/prakrit.yml @@ -0,0 +1,16 @@ +general: + name: Prakrit (Devanagari) + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Devanagari" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Devanagari" diff --git a/scriptshifter/tables/data/sanskrit.yml b/scriptshifter/tables/data/sanskrit.yml new file mode 100644 index 0000000..8bd162f --- /dev/null +++ b/scriptshifter/tables/data/sanskrit.yml @@ -0,0 +1,16 @@ +general: + name: Sanskrit (Devanagari) + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Devanagari" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Devanagari" diff --git a/scriptshifter/tables/data/sinhalese.yml b/scriptshifter/tables/data/sinhalese.yml new file mode 100644 index 0000000..58ae0db --- /dev/null +++ b/scriptshifter/tables/data/sinhalese.yml @@ -0,0 +1,16 @@ +general: + name: Sinhalese + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Sinhala" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Sinhala" diff --git a/scriptshifter/tables/data/telugu.yml b/scriptshifter/tables/data/telugu.yml new file mode 100644 index 0000000..a1267b8 --- /dev/null +++ b/scriptshifter/tables/data/telugu.yml @@ -0,0 +1,16 @@ +general: + name: Telugu + +script_to_roman: + hooks: + post_config: + - + - aksharamukha.romanizer.s2r_post_config + - src_script: "Telugu" + +roman_to_script: + hooks: + post_config: + - + - aksharamukha.romanizer.r2s_post_config + - dest_script: "Telugu"