[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs i18n
From: |
Mattias Engdegård |
Subject: |
Re: Emacs i18n |
Date: |
Mon, 25 Mar 2019 23:05:03 +0100 |
25 mars 2019 kl. 22.11 skrev Juri Linkov <address@hidden>:
>
> Is it possible to generate a regexp from ngettext arguments?
> For example, given the same arguments and calling a hypothetical
> function ‘rx-ngettext’:
>
> (rx-ngettext "finished with %d match found\n"
> "finished with %d matches found\n")
>
> to generate a regexp like:
>
> "finished with \\(?:\\(\\(?:[0-9]+ \\)?match\\(?:es\\)? found\\)"
Trivially so by generating an or-pattern: "singular text\\|plural text".
Anything better is a matter of optimisation, basically a diff algorithm (or
just prefix and suffix merging).
Is it practical, though? For %s, we would need to generate a match-anything
subexpression, even though the argument is much more constrained in practice.
- Re: Emacs i18n, (continued)
- Re: Emacs i18n, Eli Zaretskii, 2019/03/24
- Re: Emacs i18n, Jean-Christophe Helary, 2019/03/25
- Re: Emacs i18n, Juri Linkov, 2019/03/25
- Re: Emacs i18n, Eli Zaretskii, 2019/03/25
- Re: Emacs i18n, Richard Stallman, 2019/03/27
- Re: Emacs i18n, Mattias Engdegård, 2019/03/25
- Re: Emacs i18n, Eli Zaretskii, 2019/03/25
- Re: Emacs i18n, Juri Linkov, 2019/03/25
- Re: Emacs i18n,
Mattias Engdegård <=
- Re: Emacs i18n, Juri Linkov, 2019/03/27
- Re: Emacs i18n, Mattias Engdegård, 2019/03/28
Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Richard Stallman, 2019/03/03
- Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Eli Zaretskii, 2019/03/04
- Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Paul Eggert, 2019/03/04
- Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Eli Zaretskii, 2019/03/04
- Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Paul Eggert, 2019/03/04
- Re: Emacs i18n, Juri Linkov, 2019/03/05
- Re: Emacs i18n, Richard Stallman, 2019/03/05
- Re: Emacs i18n, Eli Zaretskii, 2019/03/06