[Top][All Lists]

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

Re: [emacs-bidi] debugging visual-to-logical

From: Alex Schroeder
Subject: Re: [emacs-bidi] debugging visual-to-logical
Date: Mon, 19 Nov 2001 12:19:23 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

Eli Zaretskii <address@hidden> writes:

> Sorry, no.  The output should be one of the possible inputs, but we
> should try to make it reasonable.  "<Hshalom<123</H123>" isn't.
> Reversing the input before the conversion would make in reasonable, as
> your other mail demonstrates.
> Note that "my 123CAR" as the result of the example above _is_
> reasonable.

Hm, as far as computers go, "resonable" is not a good predicate.
Furthermore, users usually don't see the logical representation, so
humans won't even be in the position to judge wether a representation
is reasonable.  Unless you assume that reasonable is what a user would
type when typing a search string and you don't need a canonical form
because the buffer representation is always "reasonable".

Assuming we don't want a canonical form, therefore the logical
representation in the buffer is required to be "reasonable", and the
way to determine this, is: "Would a human type a search string in this

Here's a guess: If users type numbers first, we could eliminate this
problem.  There are probably more of these extra rules around: We need
to find them such as the eliminate "unreasonable" logical
representations.  This might be rather hairy.

Anyway, numbers first:

The visual to logical transformation could be described as follows:
Apply rules W1 to W6.  If you have a group of EN following a group of
R, then exchange them.  Continue applying rules W7, N1, N2, etc.  I
expect that such a new rule would result in numbers ending up further
towards the beginning of the logical representation.

The logical representations are "equal" in the sense that their visual
representations are string-equal:

m  y     C  A  R  1  2  3
L  L  L  R  R  R  EN EN EN
0  0  0  1  1  1  2  2  2

=> The numbers end up in front of the R.

m  y     1  2  3  C  A  R
L  L  L  EN EN EN R  R  R
0  0  0  0  0  0  1  1  1

=> The numbers stay in front of the R.

The question is: "Is this logical representation reasonable for

Personally I don't really think so, and I think that my suggestion is
not that good.  I remain convinced that we cannot determine what is
"reasonable" using an algorithm.  The counter example is "my SLK230"
where "SLK230" is a specific name, a label.  It displays as "my
230KLS".  You would never search for it by typing "m y 2 3 0 S L K".
Therefore putting numbers first is not always "reasonable".

How about this approach: We identify the operations on the logical
representations which have no effect on the visual representation.
This might be easier to do than to identify potential problems and
arguing about "resonable" or not.  Then we can write a function which,
given a logical representation, generates various equivalent logical
representations.  Perhaps we can identify patterns of "usage" (what
people think is reasonable), or we can just make the default
representation customizable, or we can provide a function that
operates on the region, temporarily shows the logical representation
and allows the user to reshuffle it.


reply via email to

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