[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Character group folding in searches
From: |
Stefan Monnier |
Subject: |
Re: Character group folding in searches |
Date: |
Sat, 07 Feb 2015 10:02:52 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
>> Could it handle for example an equivalence class which includes
>> →, ⇒, ->, and => ?
> These are our application-specific equivalences, they are not in
> Unicode.
I know.
> So we will need to have a list of equivalences in addition
> to Unicode, that we will want to add to the "folding" char-table,
> either permanently or as buffer-local customizations.
To me the simplest option is to have a DFA which returns an integer
(this integer being "the equivalence class number", and which will
usually be one of the characters in the equivalence class).
Each DFA node could be a char-table. So if all equivalence classes are
made up of single-chars, the DFA collapses is just a plain-old
char-table mapping chars to the canonical element of their
equivalence classes. For 2-char elements, we'll arrange for the
entry for the first char (in the main char-table) to be not an integer
but another char-table. Being a DFA, this could easily handle complex
elements (matching arbitrary regular expressions), tho whether we'd make
much use of this particular feature is not very important.
Since some of the nodes in the DFA would likely only handle a very few
chars specially, we could later improve the representation so that those
nodes don't use up a whole char-table.
Stefan
PS: And this same kind of "char-table extended into a DFA" could be
useful for syntax-tables in order to provide much more flexible support
for multi-character comment markers or "paren-like nested elements".
- Re: Character group folding in searches, (continued)
- Re: Character group folding in searches, Stefan Monnier, 2015/02/06
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/06
- Re: Character group folding in searches, Artur Malabarba, 2015/02/06
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/06
- Re: Character group folding in searches, Artur Malabarba, 2015/02/06
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/07
- Re: Character group folding in searches, Stefan Monnier, 2015/02/06
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/06
- Re: Character group folding in searches, Stefan Monnier, 2015/02/06
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/07
- Re: Character group folding in searches,
Stefan Monnier <=
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/07
- Re: Character group folding in searches, Stefan Monnier, 2015/02/08
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/08
- Re: Character group folding in searches, Stefan Monnier, 2015/02/08
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/09
- Re: Character group folding in searches, Stefan Monnier, 2015/02/09
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/09
- Re: Character group folding in searches, Stefan Monnier, 2015/02/09
- Re: Character group folding in searches, Eli Zaretskii, 2015/02/10
Re: Character group folding in searches, Juri Linkov, 2015/02/06