m17n-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Request to add a new layout for Malayalam


From: Mike FABIAN
Subject: Re: Request to add a new layout for Malayalam
Date: Mon, 06 Nov 2023 11:20:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Ajith R <ajithramayyan@yahoo.co.in> さんはかきました:

> 3) I also want the vowel keys to form the vowel signs when they are
> pressed after a consonant (or the gemination key I defined). Currently
> vowel signs are formed based on what was typed last. If not
> consonants, vowel letters form. While this is okay, it is not
> ideal. After pressing delete or moving the cursor, it will not provide
> vowel
> signs. Does 
> https://git.savannah.nongnu.org/cgit/m17n/m17n-db.git/tree/MIM/bn-national-jatiya.mim
> implement such a logic? Could you explain it a bit?


bn-national-jatiya.mim has a variable use-automatic-vowel-forming which
is set to 1 by default. If use-automatic-vowel-forming is 1 and one
types `a` **not** after a consonant then one gets:

ঋ U+098B BENGALI LETTER VOCALIC R

But if one types this `a` after a consonant, for example `ka` one gets:

তৃ which is ত U+09A4 BENGALI LETTER TA + ৃ U+09C3 BENGALI VOWEL SIGN VOCALIC R

If the variable use-automatic-vowel-forming is 0, then typing `a`
**always** gives

ৃ U+09C3 BENGALI VOWEL SIGN VOCALIC R

no matter whether it is typed after a consonant or not. 

It works basically like this:

In the beginning, the consonant-flag is set to 0 if
automatic-vowel-forming is 1, if not consonant-flag is set to 1 (because
in that case the behaviour is always as if a consonant had been there):

(state
 (init
  (t (cond
      ((= use-automatic-vowel-forming 1) (set consonant-flag 0))
      (1 (set consonant-flag 1))))

If a consonant is typed, consonant-flag is set to 1 and it shifts to the
after-consonant:

(consonants (set consonant-flag 1) (shift after-consonant))

The maps dependent-vowel-signs and
additional-dependent-vowel-signs-for-sanskrit check the value of
consonant-flag and behave differently depending on that value:

 (dependent-vowel-signs
  ("h" (cond ((= consonant-flag 0) "আ")    ; U+0986 BENGALI LETTER AA
             ((= consonant-flag 1) "া")))  ; U+09BE BENGALI VOWEL SIGN AA
  ("d" (cond ((= consonant-flag 0) "ই")     ; U+0987 BENGALI LETTER I
             ((= consonant-flag 1) "ি")))  ; U+09BF BENGALI VOWEL SIGN I
  ("D" (cond ((= consonant-flag 0) "ঈ")     ; U+0988 BENGALI LETTER II
             ((= consonant-flag 1) "ী")))  ; U+09C0 BENGALI VOWEL SIGN II
  ("s" (cond ((= consonant-flag 0) "উ")     ; U+0989 BENGALI LETTER U
             ((= consonant-flag 1) "ু")))   ; U+09C1 BENGALI VOWEL SIGN U
  ("S" (cond ((= consonant-flag 0) "ঊ")     ; U+098A BENGALI LETTER UU
             ((= consonant-flag 1) "ূ")))   ; U+09C2 BENGALI VOWEL SIGN UU
  ("a" (cond ((= consonant-flag 0) "ঋ")     ; U+098B BENGALI LETTER VOCALIC R
             ((= consonant-flag 1) "ৃ")))   ; U+09C3 BENGALI VOWEL SIGN VOCALIC 
R
  ((G-e) (cond ((= consonant-flag 0) "ৠ")   ; U+09E0 BENGALI LETTER VOCALIC RR
               ((= consonant-flag 1) "ৄ"))) ; U+09C4 BENGALI VOWEL SIGN VOCALIC 
RR
  ("c" (cond ((= consonant-flag 0) "এ")     ; U+098F BENGALI LETTER E
             ((= consonant-flag 1) "ে")))  ; U+09C7 BENGALI VOWEL SIGN E
  ("C" (cond ((= consonant-flag 0) "ঐ")     ; U+0990 BENGALI LETTER AI
             ((= consonant-flag 1) "ৈ")))  ; U+09C8 BENGALI VOWEL SIGN AI
  ("x" (cond ((= consonant-flag 0) "ও")     ; U+0993 BENGALI LETTER O
             ((= consonant-flag 1) "ো")))  ; U+09CB BENGALI VOWEL SIGN O
  ("X" (cond ((= consonant-flag 0) "ঔ")     ; U+0994 BENGALI LETTER AU
             ((= consonant-flag 1) "ৌ")))  ; U+09CC BENGALI VOWEL SIGN AU
  )

 (additional-dependent-vowel-signs-for-sanskrit
  ((G-q) (cond ((= consonant-flag 0) "ঌ")   ; U+098C BENGALI LETTER VOCALIC L
               ((= consonant-flag 1) "ৢ"))) ; U+09E2 BENGALI VOWEL SIGN VOCALIC 
L
  ((G-Q) (cond ((= consonant-flag 0) "ৡ")   ; U+09E1 BENGALI LETTER VOCALIC LL
               ((= consonant-flag 1) "ৣ"))) ; U+09E3 BENGALI VOWEL SIGN VOCALIC 
LL
  )

I did that to achieve exactly the same behaviour using
bn-national-jatiya.mim as when using the "National Jatiya" layout in
https://github.com/OpenBangla/OpenBangla-Keyboard which has a "Automatic
Vowel Forming" option which behaves exactly like that.

*Maybe* this is similar to what you want. But if this is not exactly
what you want, there are many other .mim files which do quite fancy stuff, it 
might be
usefull to browse the other .mim files to see what is possible. This
lisp language of the .mim files is quite powerful, one can do a lot with that.

-- 
Mike FABIAN <mfabian@redhat.com>
睡眠不足はいい仕事の敵だ。




reply via email to

[Prev in Thread] Current Thread [Next in Thread]