[Top][All Lists]

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

RE: char equivalence classes in search - why not symmetric?

From: Drew Adams
Subject: RE: char equivalence classes in search - why not symmetric?
Date: Wed, 9 Sep 2015 20:12:37 -0700 (PDT)

> AFAICT, this (or similar) is the only code needed.

Sorry, I spoke too soon.

1. The following two lines are needed, before evaluating the code
I sent earlier.  (I've attached an update that includes them, so
you can just load/evaluate it.)

 (setq character-fold-search t)
 (load-library "character-fold")

This is due to the way the vanilla code is at the moment.  This also
means that for this testing char folding will be on, to start with.

2. The code I have is not sufficient for everything.  You can
use it to see what the behavior is for single-char entries in the
char table, which includes accented chars (chars with diacritics).
But it does not also handle multiple-char entries in the table.

For instance, you can search for "é" and get char folding, but you
cannot search for "é" and get char folding.  The first of these is
just the char named LATIN SMALL LETTER E WITH ACUTE.  The second is
plain "e" composed with "́" (the char named COMBINING ACUTE ACCENT).

Some more work would be needed to make such combinations work too.
As I said, I'm no expert on char tables.  But the attached code
should give you a good idea of what is involved.

At the end of the file I included some commented-out e chars to
search for.  (Use `C-u C-x =' on a char to see what it really is.)

Attachment: symmetric-char-fold.el
Description: Binary data

reply via email to

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