Re: tsearch2 dictionary for statute cites

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch2 dictionary for statute cites
Date: 2009-04-07 09:08:26
Message-ID: Pine.LNX.4.64.0904071307280.31919@sn.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Kevin,

contrib/test_parser - an example parser code.

On Mon, 6 Apr 2009, Kevin Grittner wrote:

> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
>>> People are likely to search for statute cites, which tend to have a
>>> hierarchical form.
>
>> I think what you need is a custom parser
>
> I've just returned to this and after review have become convinced that
> this is absolutely necessary; once the default parser has done its
> work, figuring out the bounds of a statute cite would be next to
> impossible. Examples of the kind of fun you can have labeling
> statutes, ordinances, and rules should you ever get elected to public
> office:
>
> 10-3-350.10(1)(k)
> 10.1(40)(d)1
> 10.40.040(c)(2)
> 100.525(2)(a)3
> 105-10.G(3)(a)
> 11.04C.3.R.(1)
> 8.961.41(cm)
> 9.125.07(4A)(3)
> 947.013(1m)(a)
>
> In any of these, a search string which exactly matches something up to
> (but not including) a dash, dot, or left paren should find that thing.
>
>> Unfortunately we don't seem to have any really easy way to plug in a
>> custom parser, other than copy-paste-modify the existing one which
>> would be a PITA from a maintenance standpoint.
>
> I'm afraid I'm going to have to bite the bullet and do this anyway.
> Any guidance on how to go about it may save me some time. Also, if
> there is any way to do this which may be useful to others or integrate
> into PostgreSQL to reduce the long-term PITA aspect, I'm all ears.
>
> -Kevin
>
>

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-04-07 09:34:31 bug in 8.4 pg_dumpall ?
Previous Message Glyn Astill 2009-04-07 08:35:21 Re: writing c functions for postgres