eval.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <sys/types.h>
#include "../cl/globals.h"
#include "../cl/macros.h"
#include "../cl/corpus.h"
#include <regex.h>
#include "../cl/attributes.h"
#include "../cl/cdaccess.h"
#include "../cl/special-chars.h"
#include "cqp.h"
#include "ranges.h"
#include "options.h"
#include "tree.h"
#include "symtab.h"
#include "corpmanag.h"
#include "regex2dfa.h"
#include "eval.h"
#include "builtins.h"
#include "output.h"
#include "matchlist.h"

Defines

Functions


Define Documentation

#define no_match   -1
#define RED_THRESHOLD   0.01

Referenced by matchfirstpattern().


Function Documentation

Boolean calculate_initial_matchlist ( Constrainttree  ctptr,
Matchlist matchlist,
CorpusList corpus 
)
Boolean calculate_initial_matchlist_1 ( Constrainttree  ctptr,
Matchlist matchlist,
CorpusList corpus 
)
int check_alignment_constraints ( Matchlist ml  ) 
void cqp_run_mu_query ( int  keep_old_ranges,
int  cut_value 
)
void cqp_run_query ( int  cut,
int  keep_old_ranges 
)

References eep, hard_cut, and simulate_dfa().

Referenced by do_StandardQuery().

void cqp_run_tab_query ( int  implode  ) 
Boolean eval_bool ( Constrainttree  ctptr,
RefTab  rt,
int  corppos 
)
Boolean eval_constraint ( AVS  avs,
int  corppos,
RefTab  labelrefs,
RefTab  target_labelrefs 
)
int eval_mu_tree ( Evaltree  et,
Matchlist ml 
)
int free_environment ( int  thisenv  ) 

Frees an evaluation environment.

Parameters:
thisenv The eval environment to free.
Returns:
Boolean: true if the deletion went OK; false if the environment to be freed was not occupied (will print an error message).

References Anchor, ctxtsp::attrib, cl_delete_regex(), cl_free, delete_symbol_table(), ctxtsp::direction, eep, Environment, False, free_booltree(), free_dfa(), free_evaltree(), evalenv::gconstraint, evalenv::has_target_indicator, evalenv::labels, leftright, MatchAll, evalenv::MaxPatIndex, NoField, Pattern, evalenv::patternlist, evalenv::query_corpus, evalenv::search_context, ctxtsp::size, Tag, ctxtsp::type, cl::type, and word.

Referenced by free_environments().

void free_environments ( void   ) 

References eep, and free_environment().

Referenced by in_UnnamedCorpusCommand(), and prepare_input().

int get_corpus_positions ( Attribute attribute,
char *  wordform,
Matchlist matchlist 
)
int get_label_referenced_position ( LabelEntry  label,
RefTab  rt,
int  corppos 
)
Boolean get_leaf_value ( Constrainttree  ctptr,
RefTab  rt,
int  corppos,
DynCallResult dcr,
int  deliver_strings 
)
int get_matched_corpus_positions ( Attribute attribute,
char *  regstr,
int  canonicalize,
Matchlist matchlist,
int *  restrictor_list,
int  restrictor_size 
)

Get corpus positions matching a regular expression on a given attribute.

get_matched_corpus_positions looks in a corpus which is to be loaded for a regular expression 'regstr' of attribute 'attr' and returns the table of matching start indices (start_table) and the tablesize (tabsize).

Parameters:
attribute The attribute to search on. May be NULL, in which case DEFAULT_ATT_NAME is used.
regstr String containing the regular expression.
canonicalize Flags to be passed to the CL regex engine.
matchlist Location where the list of matches will be placed.
restrictor_list ??
restrictor_size ??
Returns:
The number of matches found.

References ATT_POS, cl_free, cl_malloc(), collect_matches(), collect_matching_ids(), DEFAULT_ATT_NAME, eval_debug, find_attribute(), get_attribute_size(), get_id_range(), initial_matchlist_debug, _Matchlist::is_inverted, _Matchlist::matches_whole_corpus, range, silent, cl::size, _Matchlist::start, STREQ, and _Matchlist::tabsize.

Referenced by calculate_initial_matchlist_1(), and matchfirstpattern().

static int intcompare ( const void *  i,
const void *  j 
) [static]

Referenced by eval_bool().

int mark_offrange_cells ( Matchlist matchlist,
CorpusList corpus 
)
Boolean matchfirstpattern ( AVS  pattern,
Matchlist matchlist,
CorpusList corpus 
)
int meet_mu ( Matchlist list1,
Matchlist list2,
int  lw,
int  rw,
Attribute struc 
)
int next_environment ( void   ) 
int nr_positions ( CorpusList cp  ) 

References cl::range, and cl::size.

Referenced by red_factor().

float red_factor ( CorpusList cp,
int *  nr_pos 
)
void set_corpus_matchlists ( CorpusList cp,
Matchlist matchlist,
int  nr_lists,
int  keep_old_ranges 
)
void show_environment ( int  thisenv  ) 
void simulate ( Matchlist matchlist,
int *  cut,
int  start_state,
int  start_offset,
int *  state_vector,
int *  target_vector,
RefTab reftab_vector,
RefTab reftab_target_vector,
int  start_transition 
)
void simulate_dfa ( int  envidx,
int  cut,
int  keep_old_ranges 
)

Generated on Sun Feb 28 18:08:04 2010 for CWB by  doxygen 1.6.1