Public Attributes
tag_crfsuite_dictionary Struct Reference

CRFSuite dictionary interface. More...

List of all members.

Public Attributes

void * internal
 Pointer to the internal data (internal use only).
int nref
 Reference counter (internal use only).
int(* addref )(crfsuite_dictionary_t *dic)
 Increment the reference counter.
int(* release )(crfsuite_dictionary_t *dic)
 Decrement the reference counter.
int(* get )(crfsuite_dictionary_t *dic, const char *str)
 Assign and obtain the integer ID for the string.
int(* to_id )(crfsuite_dictionary_t *dic, const char *str)
 Obtain the integer ID for the string.
int(* to_string )(crfsuite_dictionary_t *dic, int id, char const **pstr)
 Obtain the string for the ID.
int(* num )(crfsuite_dictionary_t *dic)
 Obtain the number of strings in the dictionary.
void(* free )(crfsuite_dictionary_t *dic, const char *str)
 Free the memory block allocated by to_string() function.

Detailed Description

CRFSuite dictionary interface.


Member Data Documentation

Increment the reference counter.

Parameters:
dicThe pointer to this dictionary instance.
Returns:
int The reference count after this increment.
void(* tag_crfsuite_dictionary::free)(crfsuite_dictionary_t *dic, const char *str)

Free the memory block allocated by to_string() function.

Parameters:
dicThe pointer to this dictionary instance.
strThe pointer to the string whose memory block is freed.
int(* tag_crfsuite_dictionary::get)(crfsuite_dictionary_t *dic, const char *str)

Assign and obtain the integer ID for the string.

Parameters:
dicThe pointer to this dictionary instance.
strThe string.
Returns:
int The ID associated with the string if any, the new ID otherwise.

Obtain the number of strings in the dictionary.

Parameters:
dicThe pointer to this dictionary instance.
Returns:
int The number of strings stored in the dictionary.

Decrement the reference counter.

Parameters:
dicThe pointer to this dictionary instance.
Returns:
int The reference count after this operation.

Obtain the integer ID for the string.

Parameters:
dicThe pointer to this dictionary instance.
strThe string.
Returns:
int The ID associated with the string if any, -1 otherwise.
int(* tag_crfsuite_dictionary::to_string)(crfsuite_dictionary_t *dic, int id, char const **pstr)

Obtain the string for the ID.

Parameters:
dicThe pointer to this dictionary instance.
idthe string ID.
pstr*pstr points to the string associated with the ID if any, NULL otherwise.
Returns:
int 0 if the string ID is associated with a string, 1 otherwise.

Copyright (c) 2002-2011 by Naoaki Okazaki
Thu Aug 11 2011 12:37:06