CWB
|
#include "corpmanag.h"
The TableOp enumeration: specifies an operation to apply to a table.
More...#define _cqp_table_h_ |
The table object.
Tables are used to store query results, i.e. subcorpora with optional target fields.
All fields (Match, MatchEnd, and the various Target fields) are treated uniformly as the columns of a table: {table.field[MatchField]}, {table.field[MatchEndField]}, ... {table.size} is the number of rows (i.e. the number of cells in each column). Each column may be undefined, i.e. NULL. Rows where the MatchField column equals -1 are understood as 'deleted' rows. To allow tables to grow automatically, the number of allocated rows {table.allocated} may be greater than {table.size}. All columns must be allocated to the same size.
typedef enum _table_ops TableOp |
The TableOp enumeration: specifies an operation to apply to a table.
These are used as parameters to the table_setp() function.
We may want to change these ops and/or their exact semantics; however, for a smooth migration of the query evaluation component, it is advantageous to provide precise equivalents of the "traditional" operations
enum _table_ops |
The TableOp enumeration: specifies an operation to apply to a table.
These are used as parameters to the table_setp() function.
We may want to change these ops and/or their exact semantics; however, for a smooth migration of the query evaluation component, it is advantageous to provide precise equivalents of the "traditional" operations
void delete_table | ( | table | t | ) |
destroy table object (deallocate all data)
table new_table | ( | void | ) |
create and initialise new table (setting size and allocation to zero)
table new_table_from_list | ( | int * | list, |
unsigned | size | ||
) |
initialise new table inserting {list} as match column (sets table.size = table.allocated = size)
void table_allocate | ( | table | t, |
int | size | ||
) |
extend allocated space to exactly {size} rows (must be >= table.size)
returns True if {fld} column is defined (i.e.
!= NULL) in table {t}
get value of {row}th entry in {fld} column; returns -1 if column is NULL or row is out of range
int* table_get_sortidx | ( | table | t | ) |
Gets a pointer to sort index as int vector; returns NULL if table is unsorted.
Gets a pointer to int vector representing column {fld} for direct access; note that sortidx is ignored!
int table_normalise | ( | table | t | ) |
delete rows where match=-1 or matchend=-1, as well as duplicates; then sort by corpus position; returns True iff successful; note that both the MatchField and the MatchEndField column must be defined
Sets {row}th entry in {fld} column to {value}; automatically allocates and extends columns.
execute unary or binary operation {op}; result is stored in {t1}; returns True iff successful
unsigned table_size | ( | table | t | ) |
current size of table; encapsulates variable table.size