Frog
Classes | Macros | Functions
Parser.cxx File Reference
#include "frog/Parser.h"
#include <sys/types.h>
#include <unistd.h>
#include <cstdlib>
#include <string>
#include <map>
#include <iostream>
#include <fstream>
#include <algorithm>
#include "config.h"
#include "ticcutils/Configuration.h"
#include "ticcutils/PrettyPrint.h"
#include "ticcutils/SocketBasics.h"
#include "ticcutils/json.hpp"
#include "timbl/TimblAPI.h"
#include "frog/Frog-util.h"
#include "frog/csidp.h"
Include dependency graph for Parser.cxx:

Classes

struct  parseData
 structure to store parsing results More...
 

Macros

#define LOG   *TiCC::Log(errLog)
 
#define DBG   *TiCC::Dbg(dbgLog)
 

Functions

ostream & operator<< (ostream &os, const parseData &pd)
 
void extract (const string &tv, string &head, string &mods)
 
vector< timbl_resulttimbl (Timbl::TimblAPI *tim, const vector< string > &instances)
 
vector< pair< string, double > > parse_vd (const string &ds)
 
void appendParseResult (frog_data &fd, const vector< parsrel > &res)
 

Macro Definition Documentation

◆ DBG

#define DBG   *TiCC::Dbg(dbgLog)

◆ LOG

#define LOG   *TiCC::Log(errLog)

Function Documentation

◆ appendParseResult()

void appendParseResult ( frog_data fd,
const vector< parsrel > &  res 
)

transfer the outcome of the parser back into the fog_data structure

Parameters
fdthe frog_data we want to add to
resthe parser's results

◆ extract()

void extract ( const string &  tv,
string &  head,
string &  mods 
)

spit a (CGN-like) tag into a head and a modifier part

Parameters
tva CGN-like tag
headthe extacted head
modsthe modfiers, concatenated using the '|' symbol

Example: the tag WW(pv,tgw,met-t) will be split into a head 'WW' and a mods string 'pv|tgw|met-t'

◆ operator<<()

ostream& operator<< ( ostream &  os,
const parseData pd 
)

output a parseData structure (debugging only)

Parameters
osthe output stream
pdthe parseData to dump
Returns
the stream

◆ parse_vd()

vector<pair<string,double> > parse_vd ( const string &  ds)

parse a ValueDistribution string into a vector of class/value pairs

Parameters
dsa string representation of a Timbl ValueDistribution
Returns
a vector of string/double pairs. Each pair is one class + it's (relative) count

◆ timbl()

vector<timbl_result> timbl ( Timbl::TimblAPI *  tim,
const vector< string > &  instances 
)

call a Timbl experiment with a list of instances

Parameters
timThe Timbl to use
instancesthe instances to feed to the Timbl
Returns
a list of timbl_result structures with the result of processing all instances