Roman - tsearch2 dictionary for Roman numerals.

Motivation for this dictionary is to control indexing of Roman numerals, and,
consequently, to minimize the number of unique words, which, in turn, may
affect the performance and generality of searching.

Dictionary accepts two init options:

* TOUPPER parameter specifies whether to convert input string to upper case
  before processint (i.e. whether to treat 'iv' the same as 'IV').  Default is
  false - process only upper-case words.  

* ORDER parameter specifies whether to require strict order of digits inside
  numeral. When true, accepts only numerals with greater digits always precede
  smaller. When false, allow it to follow in arbitrary order - i.e. treat 'IIX'
  the same as 'IXI', which in turn is simply equal to 10.

Usage:

1. Compile and install

2. Load dictionary ( assume tsearch2 is already loaded)
   psql qq < dict_roman.sql

3. Test it
 
qq=# select dict_name, dict_initoption from pg_ts_dict where  dict_name='roman';
 dict_name |      dict_initoption
-----------+----------------------------
 roman     | TOUPPER=false, ORDER=true

qq=# select lexize('roman', 'MCMXXIX');
 lexize
--------
 {1929}

qq=# select lexize('intdict','IIX');
 lexize 
--------

4. Specify roman dictionary to process lword tokens 
  (for simplicity, I did that for all configurations)

qq=# select * from pg_ts_cfgmap where tok_alias = 'lword';
     ts_name     | tok_alias | dict_name
-----------------+-----------+-----------
 default         | lword     | {en_stem}
 default_russian | lword     | {en_stem}
 utf8_russian    | lword     | {en_stem}
 simple          | lword     | {simple}

qq=# update pg_ts_cfgmap set dict_name='{roman}' where tok_alias = 'lword';
UPDATE 4
qq=# select * from pg_ts_cfgmap where tok_alias = 'lword';
     ts_name     | tok_alias | dict_name
-----------------+-----------+-----------
 default         | lword     | {roman}
 default_russian | lword     | {roman}
 utf8_russian    | lword     | {roman}
 simple          | lword     | {roman}

5. Change init options as you wish

qq# update pg_ts_dict set dict_initoption = 'TOUPPER=true, ORDER=false' where dict_name='roman';
UPDATE 1

That's all.
