[Top][All Lists]

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

[conversion fails] (was: quail input methods and conversion functions)

From: Uwe Brauer
Subject: [conversion fails] (was: quail input methods and conversion functions)
Date: Sat, 10 Feb 2018 15:18:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

   > Uwe Brauer <address@hidden> writes:

   > In the unaccentuate case (which is what your original question), it
   > should be easy to write that functionality using `quail-find-key'
   > as a base. You would have to decide how to handle failures
   > (character can't be typed using the current input method).

Actually taking iso-accentuate and un accuate as a reference it is the
accentuate part which I want to implement, for example
for the greek-ibycus

I want to replace    a)  by  ἀ

   > The accentuate case looks more difficult.  Quail allows more than one
   > translation candidate for a single key sequence, which leaves no good

I am puzzled now, I thought any input method should be an bijection. So
the old iso method was, wasn't it?

   > way handle these characters.  A simple example from the ipa input
   > method: tsh can translate into ʧ, tʃ, or t⁀ʃ.

I tried that out, but I obtain  ʧ none of the others.

   > Something that works with
   > input methods that do not have this ambiguity is possible, though my
   > initial look through the code leads me to believe that this is still
   > going to be more difficult to write then the (fairly trivial)
   > unaccentuate case.

I boldly took the code from iso accentuate/accentuate

And define 
(defun ibycus4-translate-conventions (from to trans-tab)
  "Translate between FROM and TO using the translation table TRANS-TAB.
  Based on iso-cvt"
      (narrow-to-region from to)
      (goto-char from)
      (let ((work-tab trans-tab)
            (buffer-read-only nil)
            (case-fold-search nil))
        (while work-tab
            (let ((trans-this (car work-tab)))
              (while (re-search-forward (car trans-this) nil t)
                (replace-match (car (cdr trans-this)) t nil)))
            (setq work-tab (cdr work-tab)))))

Then my table starts like this
(defvar ibycus4-ibycus4-to-utf8-trans-tab
   ("a)" "ἀ")
   ("a(" "ἁ")
   ("a)`" "ἂ")
   ("a(`" "ἃ")
   ("a)'" "ἄ")
   ("a('" "ἅ")))

But now surprise, surprise

   ("ἀ" "ἀ") correct
   ("ἁ" "ἁ") correct
   ("ἀ‘" "ἂ")wrong
   ("ἁ‘" "ἃ")wrong 
   ("ἀ’" "ἄ")wrong 
   ("ἁ’" "ἅ") wrong

So what is up here and what shall I do? Any help is now strongly

reply via email to

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