Classes | Functions
Dataset (attribute, item, instance, dataset)
CRFSuite C API

Classes

struct  crfsuite_attribute_t
 An attribute. More...
struct  crfsuite_item_t
 An item. More...
struct  crfsuite_instance_t
 An instance (sequence of items and labels). More...
struct  crfsuite_data_t
 A data set. More...

Functions

void crfsuite_attribute_init (crfsuite_attribute_t *attr)
 Initialize an attribute structure.
void crfsuite_attribute_set (crfsuite_attribute_t *attr, int aid, floatval_t value)
 Set an attribute and its value.
void crfsuite_attribute_copy (crfsuite_attribute_t *dst, const crfsuite_attribute_t *src)
 Copy the content of an attribute structure.
void crfsuite_attribute_swap (crfsuite_attribute_t *x, crfsuite_attribute_t *y)
 Swap the contents of two attribute structures.
void crfsuite_item_init (crfsuite_item_t *item)
 Initialize an item structure.
void crfsuite_item_init_n (crfsuite_item_t *item, int num_attributes)
 Initialize an item structure with the number of attributes.
void crfsuite_item_finish (crfsuite_item_t *item)
 Uninitialize an item structure.
void crfsuite_item_copy (crfsuite_item_t *dst, const crfsuite_item_t *src)
 Copy the content of an item structure.
void crfsuite_item_swap (crfsuite_item_t *x, crfsuite_item_t *y)
 Swap the contents of two item structures.
int crfsuite_item_append_attribute (crfsuite_item_t *item, const crfsuite_attribute_t *attr)
 Append an attribute to the item structure.
int crfsuite_item_empty (crfsuite_item_t *item)
 Check whether the item has no attribute.
void crfsuite_instance_init (crfsuite_instance_t *seq)
 Initialize an instance structure.
void crfsuite_instance_init_n (crfsuite_instance_t *seq, int num_items)
 Initialize an instance structure with the number of items.
void crfsuite_instance_finish (crfsuite_instance_t *seq)
 Uninitialize an instance structure.
void crfsuite_instance_copy (crfsuite_instance_t *dst, const crfsuite_instance_t *src)
 Copy the content of an instance structure.
void crfsuite_instance_swap (crfsuite_instance_t *x, crfsuite_instance_t *y)
 Swap the contents of two instance structures.
int crfsuite_instance_append (crfsuite_instance_t *seq, const crfsuite_item_t *item, int label)
 Append a pair of item and label to the instance structure.
int crfsuite_instance_empty (crfsuite_instance_t *seq)
 Check whether the instance has no item.
void crfsuite_data_init (crfsuite_data_t *data)
 Initialize a dataset structure.
void crfsuite_data_init_n (crfsuite_data_t *data, int n)
 Initialize a dataset structure with the number of instances.
void crfsuite_data_finish (crfsuite_data_t *data)
 Uninitialize a dataset structure.
void crfsuite_data_copy (crfsuite_data_t *dst, const crfsuite_data_t *src)
 Copy the content of a dataset structure.
void crfsuite_data_swap (crfsuite_data_t *x, crfsuite_data_t *y)
 Swap the contents of two dataset structures.
int crfsuite_data_append (crfsuite_data_t *data, const crfsuite_instance_t *inst)
 Append an instance to the dataset structure.
int crfsuite_data_maxlength (crfsuite_data_t *data)
 Obtain the maximum length of the instances in the dataset.
int crfsuite_data_totalitems (crfsuite_data_t *data)
 Obtain the total number of items in the dataset.

Function Documentation

void crfsuite_attribute_copy ( crfsuite_attribute_t dst,
const crfsuite_attribute_t src 
)

Copy the content of an attribute structure.

Parameters:
dstThe pointer to the destination.
srcThe pointer to the source.
void crfsuite_attribute_init ( crfsuite_attribute_t attr)

Initialize an attribute structure.

Parameters:
attrThe pointer to crfsuite_attribute_t.
void crfsuite_attribute_set ( crfsuite_attribute_t attr,
int  aid,
floatval_t  value 
)

Set an attribute and its value.

Parameters:
attrThe pointer to crfsuite_attribute_t.
aidThe attribute identifier.
valueThe attribute value.
void crfsuite_attribute_swap ( crfsuite_attribute_t x,
crfsuite_attribute_t y 
)

Swap the contents of two attribute structures.

Parameters:
xThe pointer to an attribute structure.
yThe pointer to another attribute structure.
int crfsuite_data_append ( crfsuite_data_t data,
const crfsuite_instance_t inst 
)

Append an instance to the dataset structure.

Parameters:
dataThe pointer to crfsuite_data_t.
instThe instance to be added to the dataset.
Returns:
int 0 if successful, -1 otherwise.
void crfsuite_data_copy ( crfsuite_data_t dst,
const crfsuite_data_t src 
)

Copy the content of a dataset structure.

Parameters:
dstThe pointer to the destination.
srcThe pointer to the source.
void crfsuite_data_finish ( crfsuite_data_t data)

Uninitialize a dataset structure.

Parameters:
dataThe pointer to crfsuite_data_t.
void crfsuite_data_init ( crfsuite_data_t data)

Initialize a dataset structure.

Parameters:
dataThe pointer to crfsuite_data_t.
void crfsuite_data_init_n ( crfsuite_data_t data,
int  n 
)

Initialize a dataset structure with the number of instances.

Parameters:
dataThe pointer to crfsuite_data_t.
nThe number of instances.
int crfsuite_data_maxlength ( crfsuite_data_t data)

Obtain the maximum length of the instances in the dataset.

Parameters:
dataThe pointer to crfsuite_data_t.
Returns:
int The maximum number of items of the instances in the dataset.
void crfsuite_data_swap ( crfsuite_data_t x,
crfsuite_data_t y 
)

Swap the contents of two dataset structures.

Parameters:
xThe pointer to a dataset structure.
yThe pointer to another dataset structure.
int crfsuite_data_totalitems ( crfsuite_data_t data)

Obtain the total number of items in the dataset.

Parameters:
dataThe pointer to crfsuite_data_t.
Returns:
int The total number of items in the dataset.
int crfsuite_instance_append ( crfsuite_instance_t seq,
const crfsuite_item_t item,
int  label 
)

Append a pair of item and label to the instance structure.

Parameters:
seqThe pointer to crfsuite_instance_t.
itemThe item to be added to the instance.
labelThe label to be added to the instance.
Returns:
int 0 if successful, -1 otherwise.
void crfsuite_instance_copy ( crfsuite_instance_t dst,
const crfsuite_instance_t src 
)

Copy the content of an instance structure.

Parameters:
dstThe pointer to the destination.
srcThe pointer to the source.
int crfsuite_instance_empty ( crfsuite_instance_t seq)

Check whether the instance has no item.

Parameters:
seqThe pointer to crfsuite_instance_t.
Returns:
int 1 if the instance has no attribute, 0 otherwise.
void crfsuite_instance_finish ( crfsuite_instance_t seq)

Uninitialize an instance structure.

Parameters:
seqThe pointer to crfsuite_instance_t.
void crfsuite_instance_init ( crfsuite_instance_t seq)

Initialize an instance structure.

Parameters:
seqThe pointer to crfsuite_instance_t.
void crfsuite_instance_init_n ( crfsuite_instance_t seq,
int  num_items 
)

Initialize an instance structure with the number of items.

Parameters:
seqThe pointer to crfsuite_instance_t.
num_itemsThe number of items.
void crfsuite_instance_swap ( crfsuite_instance_t x,
crfsuite_instance_t y 
)

Swap the contents of two instance structures.

Parameters:
xThe pointer to an instance structure.
yThe pointer to another instance structure.
int crfsuite_item_append_attribute ( crfsuite_item_t item,
const crfsuite_attribute_t attr 
)

Append an attribute to the item structure.

Parameters:
itemThe pointer to crfsuite_item_t.
attrThe attribute to be added to the item.
Returns:
int 0 if successful, -1 otherwise.
void crfsuite_item_copy ( crfsuite_item_t dst,
const crfsuite_item_t src 
)

Copy the content of an item structure.

Parameters:
dstThe pointer to the destination.
srcThe pointer to the source.
int crfsuite_item_empty ( crfsuite_item_t item)

Check whether the item has no attribute.

Parameters:
itemThe pointer to crfsuite_item_t.
Returns:
int 1 if the item has no attribute, 0 otherwise.
void crfsuite_item_finish ( crfsuite_item_t item)

Uninitialize an item structure.

Parameters:
itemThe pointer to crfsuite_item_t.
void crfsuite_item_init ( crfsuite_item_t item)

Initialize an item structure.

Parameters:
itemThe pointer to crfsuite_item_t.
void crfsuite_item_init_n ( crfsuite_item_t item,
int  num_attributes 
)

Initialize an item structure with the number of attributes.

Parameters:
itemThe pointer to crfsuite_item_t.
num_attributesThe number of attributes.
void crfsuite_item_swap ( crfsuite_item_t x,
crfsuite_item_t y 
)

Swap the contents of two item structures.

Parameters:
xThe pointer to an item structure.
yThe pointer to another item structure.

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