|
/ modules / paradigms / Textual_InformixVerity.py
SYNOPSIS
Textual_InformixVerity (table, idColumn, textColumn, cardinality,
intraColumnField=None,
mapping=TextUtils.mappings.nonAlphanumericToWhitespace,
deleteList=TextUtils.deleteLists.keepAll)
table
A table to query, e.g., "holding".
idColumn
The table's identifier column (i.e., the column to be
selected), e.g., "holding_id".
textColumn
The table column containing the text to search over
(i.e., the column against which the constraint is to be
placed), e.g., "subject_text".
cardinality
A Cardinality object representing the cardinality of
'table' with respect to 'textColumn'.
intraColumnField
The intra-column field to restrict the search to, e.g.,
"title". The default value of None means the search is
to be performed over the entire column.
mapping
A Python character mapping table (i.e., a string of
length 256, indexed by ASCII character code) to process
constraint text with. Defaults to
'nonAlphanumericToWhitespace', which maps
non-alphanumeric characters to whitespace (i.e., to word
separators).
deleteList
A string of zero or more characters to delete from
constraint text. The default is the empty string, which
keeps all characters.
DESCRIPTION
Translates a textual constraint to an Informix Verity DataBlade
function call of the form
SELECT idColumn FROM table
WHERE vts_contains(textColumn, 'op("W1", "W2", ...)')
or
SELECT idColumn FROM table
WHERE vts_contains(textColumn,
'op("W1", "W2", ...) intraColumnField')
where 'op' is the Verity operator equivalent of the constraint
operator. ("W1", "W2", ...) is a sequence of one or more words
formed from the constraint text T by 1) deleting from T any
characters that appear in 'deleteList'; 2) mapping the remaining
characters using 'mapping'; and 3) treating sequences of
whitespace characters as word separators.
The semantics of the "contains-all-words" operator will
generally be correct only if the cardinality is "1" or "1?". If
the cardinality is "0+" or "1+", wrap this paradigm in an
Adaptor_IndivisibleConcatenation paradigm.
Exceptions thrown:
no query words specified
AUTHOR
Greg Janee
gjanee@alexandria.ucsb.edu
HISTORY
$Log: Textual_InformixVerity.py,v $
Revision 1.2 2003/10/21 20:34:37 gjanee
Minor (but critical) documentation change.
Revision 1.1 2003/02/05 00:10:34 gjanee
Initial revision
|