Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Chunker - Interface to a Chunking Parser


Detailed Description

Author:
Michael Daum (see also AUTHORS and THANKS for more)
Date:
2002-09-09
Id
chunker.c,v 1.41 2004/09/01 13:42:31 micha Exp

This module offers an interface for an external chunker.

Id
chunker.h,v 1.12 2004/09/01 13:44:12 micha Exp


Data Structures

struct  ChunkerStruct
struct  ChunkStruct

Enumerations

enum  ChunkerMode { DefaultChunker, FakeChunker, RealChunker, EvalChunker }
enum  ChunkType {
  NChunk, PChunk, VChunk, NoChunk,
  UnknownChunk
}

Functions

List chunkerChunk (Chunker chunker)
void chunkerChunkDelete (Chunk chunk)
ChunkType chunkerChunkTypeOfString (String tag)
Chunk chunkerCloneChunk (Chunk chunk)
Boolean chunkerCommandValidate (String name, String value, String *var)
void chunkerDelete (Chunker chunker)
void chunkerFinalize (void)
void chunkerInitialize (void)
Chunker chunkerNew (ChunkerMode mode, LexemGraph lg)
void chunkerPrintChunks (unsigned long mode, List chunks)
void chunkerReplaceGraphemes (Chunk chunk, LexemGraph lg)
String chunkerStringOfChunkType (Chunk chunk)
Boolean cmpArcs (Arc arc1, Arc arc2)
Boolean cmpChunks (Chunk c1, Chunk c2, Chunker chunker)
Boolean cmpGraphemes (GraphemNode g1, GraphemNode g2)
Boolean compareChunks (Chunk c1, Chunk c2)
int countChunks (List chunks)
Chunk embedChunk (Chunker chunker, Chunk target, Chunk source)
int evalChunker (Chunker chunker, List annoChunks)
Chunk findChunk (List chunks, int from, int to)
GraphemNode findGrapheme (LexemGraph lg, GraphemNode gn)
List getCategories (GraphemNode gn)
String getCategory (GraphemNode gn)
List getChunks (Chunker chunker)
List getFakeChunks (Chunker chunker)
List getFakeChunksAt (Chunker chunker, Chunk parent, int index)
ChunkType getFakeChunkType (Chunker chunker, int index)
Boolean initChunker (Chunker chunker)
Boolean initFakeChunker (Chunker chunker)
Boolean initRealChunker (Chunker chunker)
Chunk mergeChunk (Chunker chunker, Chunk target, Chunk source)
Chunk newChunk (ChunkType type)
String parseGetCategory (Chunker chunker, int index)
GraphemNode parseGetGrapheme (Chunker chunker, int index)
String parseGetLabel (Chunker chunker, int index)
LevelValue parseGetLevelValue (Chunker chunker, int index)
int parseGetModifiee (Chunker chunker, int index)
List parseGetRoots (Chunker chunker)
void postProcessChunks (Chunker chunker, List chunks)
void printChunk (unsigned long mode, Chunk chunk)
void resetChunker (Chunker chunker)
int terminateChild (pid_t pid)

Variables

char ** chunkerArgs = NULL
String chunkerCommand = NULL
ChunkerMode chunkerMode = RealChunker
Boolean chunkerUseChunker = FALSE


Enumeration Type Documentation

enum ChunkerMode
 

different modes the chunker can operate in.

Enumeration values:
DefaultChunker  the globally set chunker type: one of the below
FakeChunker  read chunks from the annotation
RealChunker  call the real chunker
EvalChunker  call the real chunker and compare it to the fake chunker
Definition at line 34 of file chunker.h.

enum ChunkType
 

chunk types.

Enumeration values:
NChunk  a chunk of a nominal clause
PChunk  a chunk of a prepositional clause
VChunk  a chunk of a verbal clause
NoChunk  things which never go into a chunk
UnknownChunk  fallback
Definition at line 44 of file chunker.h.

Referenced by chunkerChunkTypeOfString(), and getFakeChunkType().


Function Documentation

List chunkerChunk Chunker  chunker  ) 
 

compute the chunks.

Parameters:
chunker the current chunker
Returns:
a list of chunks or NULL on failure.
The returned list is owned by the chunker and thus needs no extra deallocation besides chunker deletion. The list of computed chunks is then used to assert the chunking information into the LexemGraph lg. Definition at line 1553 of file chunker.c.

References CDG_ERROR, CDG_INFO, cdgPrintf(), GraphemNodeStruct::chunk, Chunk, Chunker, chunkerChunkDelete(), chunkerCloneChunk(), chunkerReplaceGraphemes(), LexemGraphStruct::chunks, ChunkerStruct::chunks, evalChunker(), EvalChunker, FakeChunker, getChunks(), getFakeChunks(), GraphemNode, ChunkerStruct::lg, ChunkerStruct::mode, ChunkStruct::nodes, NULL, RealChunker, and ChunkStruct::subChunks.

Referenced by cmdChunk(), and cnTag().

void chunkerChunkDelete Chunk  chunk  ) 
 

chunkerChunkDelete: destruct a chunk and all its subchunks.

parameters: chunk = a chunk to be deallocated Definition at line 504 of file chunker.c.

References Chunk, chunkerChunkDelete(), ChunkStruct::nodes, and ChunkStruct::subChunks.

Referenced by chunkerChunk(), chunkerChunkDelete(), getFakeChunksAt(), lgDelete(), and resetChunker().

ChunkType chunkerChunkTypeOfString String  tag  ) 
 

return the string representation of a chunk type. Definition at line 1513 of file chunker.c.

References ChunkType, NChunk, NoChunk, PChunk, and VChunk.

Referenced by getChunks().

Chunk chunkerCloneChunk Chunk  chunk  ) 
 

chunkerCloneChunk: construct a copy of a given chunk including clones of subChunks.

parameters: chunk = the original returns: the copy. Definition at line 477 of file chunker.c.

References Chunk, chunkerCloneChunk(), ChunkStruct::from, ChunkStruct::head, newChunk(), ChunkStruct::nodes, NULL, ChunkStruct::parent, ChunkStruct::subChunks, ChunkStruct::to, and ChunkStruct::type.

Referenced by chunkerChunk(), chunkerCloneChunk(), lgCopyTagScores(), and mergeChunk().

Boolean chunkerCommandValidate String  name,
String  value,
String *  var
 

validation command for chunkerCommand.

Parameters:
name name of the variable (chunkerCommand in our case)
value the value to be set
var the address of a possibly converted value
Returns:
TRUE on success
Basically the chunkerCommand value is converted into chunkerArgs which are then used when actually forking the chunker command.

See also:
chunkerInitialize, chunkerArgs
Definition at line 1803 of file chunker.c.

References CDG_ERROR, cdgFreeString(), cdgPrintf(), chunkerArgs, FALSE, NULL, and TRUE.

Referenced by chunkerInitialize().

void chunkerDelete Chunker  chunker  ) 
 

chunkerDelete: destroy the chunker representation.

parameters: chunker = the object to be destructed Definition at line 439 of file chunker.c.

References Chunker, and resetChunker().

Referenced by cmdChunk(), and cnTag().

void chunkerFinalize void   ) 
 

finalize the chunker module.

This is called by cdgFinalize. (No good module without a finalizer and a initializer.)

See also:
chunkerInitialize
Definition at line 1930 of file chunker.c.

void chunkerInitialize void   ) 
 

initialize the chunker module.

This is called only once by cdgInitialize when the application starts up.

See also:
chunkerFinalize
Definition at line 1908 of file chunker.c.

References chunkerCommand, chunkerCommandValidate(), chunkerMode, chunkerUseChunker, EvalChunker, FakeChunker, NULL, and RealChunker.

Referenced by cdgInitialize().

Chunker chunkerNew ChunkerMode  mode,
LexemGraph  lg
 

construct a new chunker.

Parameters:
mode one of the defined ChunkerMode
lg data from which we're going to initialize
Returns:
a new chunker
In case of a RealChunker a child process is forked in the background specified by the chunkerCommand. This function might return NULL when chunking is switched off, no chunkerCommand is defined or the initialization of the chunker object fails.

See also:
initChunker, initRealChunker, initFakeChunker
Definition at line 190 of file chunker.c.

References ChunkerStruct::args, CDG_ERROR, cdgPrintf(), Chunker, chunkerArgs, chunkerCommand, chunkerMode, chunkerUseChunker, ChunkerStruct::chunks, DefaultChunker, FakeChunker, FALSE, initChunker(), ChunkerStruct::lg, ChunkerStruct::mode, ChunkerStruct::nrLevels, ChunkerStruct::nrWords, NULL, ChunkerStruct::parse, and ChunkerStruct::pid.

Referenced by cmdChunk(), and cnTag().

void chunkerPrintChunks unsigned long  mode,
List  chunks
 

print the chunks of a lattice.

Parameters:
mode print mode, e.g. CDG_INFO
chunks the list of chunks to be printed
Definition at line 1495 of file chunker.c.

References cdgPrintf(), and printChunk().

Referenced by cmdChunk(), cnPrint(), cnTag(), and lgPrint().

void chunkerReplaceGraphemes Chunk  chunk,
LexemGraph  lg
 

chunkerReplaceGraphemes: replace all grapheme references in a chunk with those given in a lexemgraph.

parameters: chunk = the structure using the arcs lg = the lexemgraph using equivalent arcs Definition at line 1771 of file chunker.c.

References Chunk, findGrapheme(), ChunkStruct::from, ChunkStruct::head, ChunkStruct::nodes, ChunkStruct::subChunks, and ChunkStruct::to.

Referenced by chunkerChunk(), and lgCopyTagScores().

String chunkerStringOfChunkType Chunk  chunk  ) 
 

return the string representation of a chunk type. Definition at line 1530 of file chunker.c.

References Chunk, NChunk, PChunk, ChunkStruct::type, and VChunk.

Referenced by embedChunk(), evalTerm(), getChunks(), getFakeChunksAt(), mergeChunk(), postProcessChunks(), and printChunk().

Boolean cmpArcs Arc  arc1,
Arc  arc2
[static]
 

cmpArcs: return true if arc1 starts before arc2 Definition at line 525 of file chunker.c.

Referenced by embedChunk().

Boolean cmpChunks Chunk  c1,
Chunk  c2,
Chunker  chunker
[static]
 

cmpChunks: return true if c1 starts before c2. Definition at line 533 of file chunker.c.

References GraphemNodeStruct::arc, Chunk, Chunker, and ChunkStruct::from.

Referenced by embedChunk(), getChunks(), getFakeChunks(), getFakeChunksAt(), and mergeChunk().

Boolean cmpGraphemes GraphemNode  g1,
GraphemNode  g2
[static]
 

cmpGraphemes: return true if g1 start before g2 Definition at line 517 of file chunker.c.

References GraphemNodeStruct::arc, and GraphemNode.

Referenced by mergeChunk().

Boolean compareChunks Chunk  c1,
Chunk  c2
[static]
 

are two chunks isomorph.

Parameters:
c1 the one chunk
c2 the other chunk
Returns:
TRUE if the two chunks are equal, else FALSE
This is again a recursion where all sub chunks must match aswell. Definition at line 1621 of file chunker.c.

References GraphemNodeStruct::arc, Chunk, FALSE, ChunkStruct::from, ChunkStruct::subChunks, ChunkStruct::to, TRUE, and ChunkStruct::type.

Referenced by evalChunker().

int countChunks List  chunks  )  [static]
 

count the number of chunks.

Parameters:
chunks list of chunks to be counted
Returns:
amount of chunks
This not only counts the list length but also all sub chunks. Definition at line 1331 of file chunker.c.

References Chunk, NChunk, PChunk, ChunkStruct::subChunks, ChunkStruct::type, and VChunk.

Referenced by evalChunker().

Chunk embedChunk Chunker  chunker,
Chunk  target,
Chunk  source
[static]
 

embedChunk: embed chunk as a subchunk into the target chunk

parameters target = the resulting chunk source = the chunk to be embedded returns: the target chunk. Definition at line 846 of file chunker.c.

References GraphemNodeStruct::arc, CDG_DEBUG, cdgPrintf(), Chunk, Chunker, chunkerStringOfChunkType(), cmpArcs(), cmpChunks(), ChunkStruct::from, ChunkStruct::nodes, ChunkStruct::subChunks, and ChunkStruct::to.

Referenced by getFakeChunksAt().

int evalChunker Chunker  chunker,
List  annoChunks
[static]
 

evaluate computed agains annotated chunks.

Parameters:
chunker the current chunker
annoChunks the list of chunks extracted from the annotation
Returns:
the number of errors
Definition at line 1655 of file chunker.c.

References GraphemNodeStruct::arc, CDG_INFO, CDG_WARNING, cdgPrintf(), Chunk, Chunker, ChunkerStruct::chunks, compareChunks(), countChunks(), findChunk(), ChunkStruct::from, NChunk, NoChunk, NULL, PChunk, printChunk(), ChunkStruct::to, ChunkStruct::type, and VChunk.

Referenced by chunkerChunk().

Chunk findChunk List  chunks,
int  from,
int  to
[static]
 

search the chunk that spans over the given indices.

Parameters:
chunks a list of chunks
from the starting point of the span
to the ending point of the span
Returns:
the found Chunk or NULL if the specified span has not been chunked so far
This is a recursive function:
  • returns NULL if chunks is empty
  • returns NULL if <from-to> is not spanned by any chunk
  • returns chunk X if it spans exactly <from-to>
  • if a chunk X spans more than <from-to>
    • return X if there's no exaclty spanning sub chunk Y
    • or the found sub chunk Y inside X
Definition at line 1366 of file chunker.c.

References GraphemNodeStruct::arc, CDG_DEBUG, cdgPrintf(), Chunk, ChunkStruct::from, NULL, printChunk(), ChunkStruct::subChunks, and ChunkStruct::to.

Referenced by evalChunker(), and getChunks().

GraphemNode findGrapheme LexemGraph  lg,
GraphemNode  old
[static]
 

find an equivalent grapheme in a given lexemgraph.

parameters: lg = the lexemgraph arc = the arc (possibly not used in the lexemgraph) returns: an equivalent arc. Definition at line 1745 of file chunker.c.

References GraphemNodeStruct::arc, GraphemNode, LexemGraphStruct::graphemnodes, and NULL.

Referenced by chunkerReplaceGraphemes().

List getCategories GraphemNode  gn  )  [static]
 

getCategories: get all POS-tags of undeleted lexem nodes

parameter: gn = a lexem node returns: a list of POS tags. Definition at line 646 of file chunker.c.

References CDG_DEBUG, cdgPrintf(), GraphemNode, LexemGraphStruct::isDeletedNode, LexemNodeStruct::lexem, GraphemNodeStruct::lexemes, GraphemNodeStruct::lexemgraph, LexemNode, LexemNodeStruct::no, NULL, and LexemNodeStruct::tagscore.

Referenced by getCategory(), and printChunk().

String getCategory GraphemNode  gn  )  [static]
 

getCategory: get one POS-tag, warn if there are more than one

parameter: gn = a grapheme returns: the first POS-tag available. Definition at line 614 of file chunker.c.

References CDG_WARNING, cdgPrintf(), getCategories(), GraphemNode, and NULL.

Referenced by getChunks(), postProcessChunks(), and printChunk().

List getChunks Chunker  chunker  )  [static]
 

this is the entry function to the real chunker.

Parameters:
chunker the current chunker to be used
Returns:
a list of chunks
Writes to the chunker, reads from the chunker and builds a list of chunks. Definition at line 1152 of file chunker.c.

References GraphemNodeStruct::arc, CDG_DEBUG, CDG_ERROR, CDG_WARNING, cdgFreeString(), cdgPrintf(), Chunk, Chunker, chunkerChunkTypeOfString(), chunkerStringOfChunkType(), cmpChunks(), findChunk(), ChunkStruct::from, getCategory(), GraphemNode, LexemGraphStruct::graphemnodes, ChunkStruct::head, ChunkerStruct::lg, newChunk(), ChunkStruct::nodes, NULL, ChunkerStruct::pipe1, ChunkerStruct::pipe2, ChunkStruct::subChunks, and ChunkStruct::to.

Referenced by chunkerChunk().

List getFakeChunks Chunker  chunker  )  [static]
 

this is the entry function to the fake chunker.

Parameters:
chunker the current chunker to be used
Returns:
a list of chunks
Definition at line 1120 of file chunker.c.

References Chunker, cmpChunks(), getFakeChunksAt(), NULL, parseGetRoots(), and postProcessChunks().

Referenced by chunkerChunk().

List getFakeChunksAt Chunker  chunker,
Chunk  parent,
int  index
[static]
 

get the chunks under the given root node.

Parameters:
chunker the current chunker
parent dominating chunk
index index of the root node in the dependency tree
Definition at line 882 of file chunker.c.

References GraphemNodeStruct::arc, CDG_DEBUG, cdgPrintf(), Chunk, Chunker, chunkerChunkDelete(), chunkerStringOfChunkType(), cmpChunks(), embedChunk(), ChunkStruct::from, getFakeChunkType(), GraphemNode, ChunkStruct::head, ChunkerStruct::mainlevel, mergeChunk(), NChunk, newChunk(), ChunkStruct::nodes, NULL, ChunkStruct::parent, ChunkerStruct::parse, parseGetGrapheme(), parseGetLabel(), PChunk, ChunkStruct::to, ChunkStruct::type, UnknownChunk, and VChunk.

Referenced by getFakeChunks().

ChunkType getFakeChunkType Chunker  chunker,
int  index
[static]
 

getFakeChunkType Definition at line 741 of file chunker.c.

References Chunker, ChunkType, NChunk, NoChunk, parseGetCategory(), PChunk, UnknownChunk, and VChunk.

Referenced by getFakeChunksAt().

Boolean initChunker Chunker  chunker  )  [static]
 

initialize the chunker with the given data.

Parameters:
chunker the current chunker
Returns:
true on success.
This is called from chunkerChunk and from chunkerNew. It calls initFakeChunker or initRealChunker depending on the chunker mode. Definition at line 240 of file chunker.c.

References CDG_ERROR, cdgPrintf(), Chunker, EvalChunker, FakeChunker, FALSE, initFakeChunker(), initRealChunker(), ChunkerStruct::mode, and RealChunker.

Referenced by chunkerNew().

Boolean initFakeChunker Chunker  chunker  )  [static]
 

initialize a fake chunker with the given data.

Parameters:
chunker the current chunker
Returns:
true on success.
This function is called by initChunker() whenever the given Chunker is in mode FakeChunker. In order to work properly the contained Lattice within the LexemGraph lg must have a corresponding Annotation from which the chunks can be faked.

See also:
also initChunker, initFakeChunker, initRealChunker, chunkerChunk.
Definition at line 272 of file chunker.c.

References CDG_ERROR, cdgPrintf(), Chunker, FALSE, LexemGraphStruct::lattice, ChunkerStruct::lg, ChunkerStruct::mainlevel, ChunkerStruct::nrLevels, ChunkerStruct::nrWords, ChunkerStruct::parse, resetChunker(), and TRUE.

Referenced by initChunker().

Boolean initRealChunker Chunker  chunker  )  [static]
 

initialize a real chunker with the given data.

Parameters:
chunker the current chunker
Returns:
true on success.
This function is called from initChunker during the initialization of the chunker, that is just before it starts chunking in chunkerChunk.

See also:
also initChunker, initFakeChunker, initRealChunker, chunkerChunk.
Definition at line 332 of file chunker.c.

References ChunkerStruct::args, CDG_DEBUG, CDG_ERROR, cdgPrintf(), Chunker, FALSE, ChunkerStruct::mainlevel, ChunkerStruct::pid, ChunkerStruct::pipe1, ChunkerStruct::pipe2, and TRUE.

Referenced by initChunker().

Chunk mergeChunk Chunker  chunker,
Chunk  target,
Chunk  source
[static]
 

mergeChunk: add the source to the target chunk. the target chunk spans the words of both chunks.

parameters: chunker = the current chunker target = the resulting chunk source = the chunk to be added to the target

returns: the target chunk. Definition at line 805 of file chunker.c.

References GraphemNodeStruct::arc, CDG_DEBUG, cdgPrintf(), Chunk, Chunker, chunkerCloneChunk(), chunkerStringOfChunkType(), cmpChunks(), cmpGraphemes(), ChunkStruct::from, ChunkStruct::nodes, ChunkStruct::subChunks, and ChunkStruct::to.

Referenced by getFakeChunksAt().

Chunk newChunk ChunkType  type  )  [static]
 

construct a new chunk and initialize it.

Parameters:
type one of the ChunkTypes NChunk, PChunk, ...
Returns:
a new empty Chunk.
Definition at line 454 of file chunker.c.

References Chunk, ChunkStruct::from, ChunkStruct::head, ChunkStruct::nodes, NULL, ChunkStruct::parent, ChunkStruct::subChunks, ChunkStruct::to, and ChunkStruct::type.

Referenced by chunkerCloneChunk(), getChunks(), and getFakeChunksAt().

String parseGetCategory Chunker  chunker,
int  index
[static]
 

parseGetCategory: get the POS-tag of a given word index

parameters: chunker = the current chunker index = index of a word in the parse.

returns: the POS-tag string or NULL if not defined Definition at line 694 of file chunker.c.

References Chunker, LexemNodeStruct::lexem, LexemNode, NULL, and parseGetLevelValue().

Referenced by getFakeChunkType().

GraphemNode parseGetGrapheme Chunker  chunker,
int  index
[static]
 

parseGetGrapheme: get the grapheme node of a given word index

parameters: chunker = the current chunker index = index of a word in the parse.

returns: the arc. Definition at line 720 of file chunker.c.

References CDG_ERROR, cdgPrintf(), Chunker, GraphemNode, NULL, and parseGetLevelValue().

Referenced by getFakeChunksAt().

String parseGetLabel Chunker  chunker,
int  index
[static]
 

parseGetLabel: get the label of the dependency of a word (on the main level)

parameters: chunker = the current chunker index = index of a word in the parse returns: the label of that dependency Definition at line 585 of file chunker.c.

References Chunker, ChunkerStruct::mainlevel, ChunkerStruct::nrLevels, and ChunkerStruct::parse.

Referenced by getFakeChunksAt().

LevelValue parseGetLevelValue Chunker  chunker,
int  index
[static]
 

parseGetLevelValue: get the dependency arc of a word.

parameters: chunker = the current chunker index = index of a word in the parse.

returns: the level value of this word Definition at line 600 of file chunker.c.

References Chunker, ChunkerStruct::mainlevel, NULL, and ChunkerStruct::parse.

Referenced by parseGetCategory(), and parseGetGrapheme().

int parseGetModifiee Chunker  chunker,
int  index
[static]
 

parseGetModifiee: get the word this one is modifying (on the main level)

parameters: chunker = the current chunker index = the modifier index in the word vector of the current parse returns: the modifiee index Definition at line 571 of file chunker.c.

References Chunker, ChunkerStruct::mainlevel, ChunkerStruct::nrLevels, and ChunkerStruct::parse.

Referenced by parseGetRoots().

List parseGetRoots Chunker  chunker  )  [static]
 

parseGetRoots: get all unbound words (on the main level)

parameters: chunker = the current chunker returns: a list of word indices or NULL if there are no root bindings (?)

Note: you become the owner of the returned list container, so deallocate it after you've consumed the result. Definition at line 548 of file chunker.c.

References Chunker, ChunkerStruct::nrWords, NULL, and parseGetModifiee().

Referenced by getFakeChunks().

void postProcessChunks Chunker  chunker,
List  inputList
[static]
 

postProcessChunks: get rid of unwanted chunks.

parameters: inputList = items to be filtered Definition at line 1091 of file chunker.c.

References GraphemNodeStruct::arc, CDG_DEBUG, cdgPrintf(), Chunk, Chunker, chunkerStringOfChunkType(), ChunkStruct::from, getCategory(), NoChunk, ChunkStruct::to, ChunkStruct::type, and UnknownChunk.

Referenced by getFakeChunks().

void printChunk unsigned long  mode,
Chunk  chunk
[static]
 

printChunk: print a single chunk and all its subchunks

parameters: mode = print mode, e.g. CDG_INFO chunk = the chunk to be printed Definition at line 1423 of file chunker.c.

References GraphemNodeStruct::arc, cdgPrintf(), Chunk, chunkerStringOfChunkType(), getCategories(), getCategory(), GraphemNode, ChunkStruct::head, NoChunk, ChunkStruct::nodes, NULL, ChunkStruct::subChunks, ChunkStruct::to, and ChunkStruct::type.

Referenced by chunkerPrintChunks(), evalChunker(), and findChunk().

void resetChunker Chunker  chunker  )  [static]
 

resetChunker: set the chunker in a state of innocence.

parameters: chunker = the object of desire Definition at line 404 of file chunker.c.

References ChunkerStruct::args, cdgFreeString(), Chunker, chunkerChunkDelete(), ChunkerStruct::chunks, ChunkerStruct::lg, ChunkerStruct::nrLevels, ChunkerStruct::nrWords, NULL, ChunkerStruct::parse, ChunkerStruct::pid, ChunkerStruct::pipe1, ChunkerStruct::pipe2, and terminateChild().

Referenced by chunkerDelete(), and initFakeChunker().

int terminateChild pid_t  pid  ) 
 

terminateChild

This function waits for child with the specified pid to terminate.

Return values:

-1 error 0 child died already 1 child died after SIGTERM 2 child died after SIGKILL Definition at line 137 of file chunker.c.

References CDG_ERROR, CDG_WARNING, cdgPrintf(), and NULL.

Referenced by resetChunker().


Variable Documentation

char** chunkerArgs = NULL [static]
 

NULL terminated array of command arguments used for real chunking Definition at line 81 of file chunker.c.

Referenced by chunkerCommandValidate(), and chunkerNew().

String chunkerCommand = NULL [static]
 

string representation of the current command used for real chunking Definition at line 78 of file chunker.c.

Referenced by chunkerInitialize(), and chunkerNew().

ChunkerMode chunkerMode = RealChunker [static]
 

set the default chunker mode,

See also:
DefaultChunker
Definition at line 75 of file chunker.c.

Referenced by chunkerInitialize(), and chunkerNew().

Boolean chunkerUseChunker = FALSE [static]
 

indicates wether the chunker is used or not Definition at line 72 of file chunker.c.

Referenced by chunkerInitialize(), and chunkerNew().


CDG 0.95 (20 Oct 2004)