Re: daitch_mokotoff module
Dag Lem <dag@nimrod.no>
From: Dag Lem <dag@nimrod.no>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Thomas Munro <thomas.munro@gmail.com>, Andres Freund <andres@anarazel.de>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-01-03T13:07:09Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Avoid using non-ASCII commentary in daitch_mokotoff.c.
- 1c54b93a8cf9 16.0 landed
-
Remove some non-ASCII symbols from a comment.
- d6b5dee42de7 16.0 landed
-
Remove useless dependencies in daitch_mokotoff_header.pl.
- 2bfbad9c4220 16.0 landed
-
Pacify perlcritic.
- edc627ae2763 16.0 landed
-
Add support for Daitch-Mokotoff Soundex in contrib/fuzzystrmatch.
- a290378a3752 16.0 landed
-
Enable routine running of citext's UTF8-specific test cases.
- c2e8bd27519f 15.0 landed
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Thomas Munro <thomas.munro@gmail.com> writes:
>> Erm, it looks like something weird is happening somewhere in cfbot's
>> pipeline, because Dag's patch says:
>
>> +SELECT daitch_mokotoff('Straßburg');
>> + daitch_mokotoff
>> +-----------------
>> + 294795
>> +(1 row)
>
> ... so, that test case is guaranteed to fail in non-UTF8 encodings,
> I suppose? I wonder what the LANG environment is in that cfbot
> instance.
>
> (We do have methods for dealing with non-ASCII test cases, but
> I can't see that this patch is using any of them.)
>
> regards, tom lane
>
I naively assumed that tests would be run in an UTF8 environment.
Running "ack -l '[\x80-\xff]'" in the contrib/ directory reveals that
two other modules are using UTF8 characters in tests - citext and
unaccent.
The citext tests seem to be commented out - "Multibyte sanity
tests. Uncomment to run."
Looking into the unaccent module, I don't quite understand how it will
work with various encodings, since it doesn't seem to decode its input -
will it fail if run under anything but ASCII or UTF8?
In any case, I see that unaccent.sql starts as follows:
CREATE EXTENSION unaccent;
-- must have a UTF8 database
SELECT getdatabaseencoding();
SET client_encoding TO 'UTF8';
Would doing the same thing in fuzzystrmatch.sql fix the problem with
failing tests? Should I prepare a new patch?
Best regards
Dag Lem