CWB
Data Structures | Typedefs | Enumerations | Functions

matchlist.h File Reference

Data Structures

Typedefs

Enumerations

Functions


Typedef Documentation

typedef struct _Matchlist Matchlist

The Matchlist object.

This is a table of integers describing matches to a query.

typedef enum ml_setops MLSetOp

Set operations which can be performed on (initial) matchlists.


Enumeration Type Documentation

enum ml_setops

Set operations which can be performed on (initial) matchlists.

Enumerator:
Union 
Intersection 
Complement 
Identity 

create a copy

Uniq 

make unique lists (also called "sets" :-))

Reduce 

delete -1 items


Function Documentation

void free_matchlist ( Matchlist matchlist)
void init_matchlist ( Matchlist matchlist)
int Setop ( Matchlist list1,
MLSetOp  operation,
Matchlist list2 
)

Perform "operation" on the two match lists (can be initial).

The result is assigned to list1.

this whole code is WRONG when one of the matchlists is inverted TODO!

Also TODO: give it a better name.

This contains, by far, most of the code in the Matchlist module.

References access_corpus(), ATT_POS, CDA_OK, cl_errno, cl_free, cl_malloc(), cl_max_cpos(), cl_realloc(), Complement, cl::corpus, DEFAULT_ATT_NAME, _Matchlist::end, find_attribute, free_matchlist(), Identity, Intersection, _Matchlist::is_inverted, _Matchlist::matches_whole_corpus, MIN, evalenv::query_corpus, Reduce, Setop(), _Matchlist::start, _Matchlist::tabsize, _Matchlist::target_positions, Union, and Uniq.

Referenced by calculate_initial_matchlist(), calculate_initial_matchlist_1(), cqp_run_mu_query(), cqp_run_tab_query(), eval_mu_tree(), matchfirstpattern(), Setop(), simulate_dfa(), and try_optimization().

void show_matchlist ( Matchlist  matchlist)

Prints the entire contents of a Matchlist to NULL.

References _Matchlist::end, _Matchlist::is_inverted, _Matchlist::start, _Matchlist::tabsize, and _Matchlist::target_positions.

Referenced by simulate_dfa().

void show_matchlist_firstelements ( Matchlist  matchlist)

Prints the first few elements of a matchlist to NULL.

"First few" equals up to 1000.

Only the start positions are printed.

References _Matchlist::start, and _Matchlist::tabsize.

Referenced by simulate_dfa().