tsearch Parser Hacking

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема tsearch Parser Hacking
Дата
Msg-id C62AC9C5-9968-46ED-B952-B026F3865A79@kineticode.com
обсуждение исходный текст
Ответы Re: tsearch Parser Hacking  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: tsearch Parser Hacking  (Oleg Bartunov <oleg@sai.msu.su>)
Список pgsql-hackers
Hackers,

Is it possible to modify the default tsearch parser so that / doesn't get lexed as a "file" token? That is, instead of
this:

try=# select * from ts_debug('simple'::regconfig, 'w/d');alias │    description    │ token │ dictionaries │ dictionary
│lexemes  
───────┼───────────────────┼───────┼──────────────┼────────────┼─────────file  │ File or path name │ w/d   │ {simple}
 │ simple     │ {w/d} 

Ideally it'd think that / was the same as -:

try=# select * from ts_debug('simple'::regconfig, 'w-d');     alias      │           description           │ token │
dictionaries│ dictionary │ lexemes  
─────────────────┼─────────────────────────────────┼───────┼──────────────┼────────────┼─────────asciihword      │
Hyphenatedword, all ASCII      │ w-d   │ {simple}     │ simple     │ {w-d}hword_asciipart │ Hyphenated word part, all
ASCII│ w     │ {simple}     │ simple     │ {w}blank           │ Space symbols                   │ -     │ {}
│[null]     │ [null]hword_asciipart │ Hyphenated word part, all ASCII │ d     │ {simple}     │ simple     │ {d} 
(4 rows)

Possible? Or would I have to write a completely new parser just to change this bit?

Thanks,

David



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: sepgsql contrib module
Следующее
От: Marti Raudsepp
Дата:
Сообщение: Re: FOR KEY LOCK foreign keys