Re: [HACKERS] Unacccented Fractions

2017-03-21 Thread Peter Eisentraut
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


[HACKERS] Unacccented Fractions

2017-03-13 Thread David E. Wheeler
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

smime.p7s
Description: S/MIME cryptographic signature