Unacccented Fractions

Started by David E. Wheeleralmost 9 years ago2 messages
#1David E. Wheeler
david@justatheory.com
1 attachment(s)

Hello Hackers,

I noticed that unaccent.rules has spaces in front of the unaccented representation of fraction glyphs:

¼ 1/4
½ 1/2
¾ 3/4

Note the space after the tab. In case my client kills what I’ve pasted, those lines match

¼\t[ ]1/4
½\t[ ]1/2
¾\t[ ]3/4

This makes sense to me, as I’d like “1¼”, for example to become “1 1/4”. However, that’s not what seems to happen:

=# SELECT unaccent('1¼');
unaccent
----------
11/4

Should that space from the rules file be preserved, so that the text doesn’t become eleven fourths?

Thanks,

David

Attachments:

smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload
#2Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: David E. Wheeler (#1)
Re: Unacccented Fractions

On 3/13/17 23:01, David E. Wheeler wrote:

I noticed that unaccent.rules has spaces in front of the unaccented representation of fraction glyphs:

This makes sense to me, as I’d like “1¼”, for example to become “1 1/4”. However, that’s not what seems to happen:

These leading spaces come all the way from the input files that are used
to produce the unaccent rules, where they are presumably put for exactly
the reason you point out. However, the unaccent lexer is not prepared
for that. It just looks for any amount of whitespace separating the two
data columns. So that might have to be fixed.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers