#![allow(unknown_lints)]
#![allow(clippy::all)]
use libc::{self, FILE};
pub const CRFSUITE_VERSION: &'static [u8; 7usize] = b"0.12.2\0";
pub const CRFSUITE_COPYRIGHT: &'static [u8; 39usize] = b"Copyright (c) 2007-2013 Naoaki Okazaki\0";
pub type floatval_t = f64;
pub const CRFSUITE_SUCCESS: _bindgen_ty_1 = 0;
pub const CRFSUITEERR_UNKNOWN: _bindgen_ty_1 = -2147483648;
pub const CRFSUITEERR_OUTOFMEMORY: _bindgen_ty_1 = -2147483647;
pub const CRFSUITEERR_NOTSUPPORTED: _bindgen_ty_1 = -2147483646;
pub const CRFSUITEERR_INCOMPATIBLE: _bindgen_ty_1 = -2147483645;
pub const CRFSUITEERR_INTERNAL_LOGIC: _bindgen_ty_1 = -2147483644;
pub const CRFSUITEERR_OVERFLOW: _bindgen_ty_1 = -2147483643;
pub const CRFSUITEERR_NOTIMPLEMENTED: _bindgen_ty_1 = -2147483642;
pub type _bindgen_ty_1 = libc::c_int;
pub type crfsuite_model_t = tag_crfsuite_model;
pub type crfsuite_trainer_t = tag_crfsuite_trainer;
pub type crfsuite_tagger_t = tag_crfsuite_tagger;
pub type crfsuite_dictionary_t = tag_crfsuite_dictionary;
pub type crfsuite_params_t = tag_crfsuite_params;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct crfsuite_attribute_t {
pub aid: libc::c_int,
pub value: floatval_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct crfsuite_item_t {
pub num_contents: libc::c_int,
pub cap_contents: libc::c_int,
pub contents: *mut crfsuite_attribute_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct crfsuite_instance_t {
pub num_items: libc::c_int,
pub cap_items: libc::c_int,
pub items: *mut crfsuite_item_t,
pub labels: *mut libc::c_int,
pub weight: floatval_t,
pub group: libc::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct crfsuite_data_t {
pub num_instances: libc::c_int,
pub cap_instances: libc::c_int,
pub instances: *mut crfsuite_instance_t,
pub attrs: *mut crfsuite_dictionary_t,
pub labels: *mut crfsuite_dictionary_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct crfsuite_label_evaluation_t {
pub num_correct: libc::c_int,
pub num_observation: libc::c_int,
pub num_model: libc::c_int,
pub precision: floatval_t,
pub recall: floatval_t,
pub fmeasure: floatval_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct crfsuite_evaluation_t {
pub num_labels: libc::c_int,
pub tbl: *mut crfsuite_label_evaluation_t,
pub item_total_correct: libc::c_int,
pub item_total_num: libc::c_int,
pub item_total_observation: libc::c_int,
pub item_total_model: libc::c_int,
pub item_accuracy: floatval_t,
pub inst_total_correct: libc::c_int,
pub inst_total_num: libc::c_int,
pub inst_accuracy: floatval_t,
pub macro_precision: floatval_t,
pub macro_recall: floatval_t,
pub macro_fmeasure: floatval_t,
}
pub type crfsuite_logging_callback = ::std::option::Option<
unsafe extern "C" fn(
user: *mut libc::c_void,
format: *const libc::c_char,
args: *mut __va_list_tag,
) -> libc::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tag_crfsuite_model {
pub internal: *mut libc::c_void,
pub nref: libc::c_int,
pub addref:
::std::option::Option<unsafe extern "C" fn(model: *mut crfsuite_model_t) -> libc::c_int>,
pub release:
::std::option::Option<unsafe extern "C" fn(model: *mut crfsuite_model_t) -> libc::c_int>,
pub get_tagger: ::std::option::Option<
unsafe extern "C" fn(
model: *mut crfsuite_model_t,
ptr_tagger: *mut *mut crfsuite_tagger_t,
) -> libc::c_int,
>,
pub get_labels: ::std::option::Option<
unsafe extern "C" fn(
model: *mut crfsuite_model_t,
ptr_labels: *mut *mut crfsuite_dictionary_t,
) -> libc::c_int,
>,
pub get_attrs: ::std::option::Option<
unsafe extern "C" fn(
model: *mut crfsuite_model_t,
ptr_attrs: *mut *mut crfsuite_dictionary_t,
) -> libc::c_int,
>,
pub dump: ::std::option::Option<
unsafe extern "C" fn(model: *mut crfsuite_model_t, fpo: *mut FILE) -> libc::c_int,
>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tag_crfsuite_trainer {
pub internal: *mut libc::c_void,
pub nref: libc::c_int,
pub addref: ::std::option::Option<
unsafe extern "C" fn(trainer: *mut crfsuite_trainer_t) -> libc::c_int,
>,
pub release: ::std::option::Option<
unsafe extern "C" fn(trainer: *mut crfsuite_trainer_t) -> libc::c_int,
>,
pub params: ::std::option::Option<
unsafe extern "C" fn(trainer: *mut crfsuite_trainer_t) -> *mut crfsuite_params_t,
>,
pub set_message_callback: ::std::option::Option<
unsafe extern "C" fn(
trainer: *mut crfsuite_trainer_t,
user: *mut libc::c_void,
cbm: crfsuite_logging_callback,
),
>,
pub train: ::std::option::Option<
unsafe extern "C" fn(
trainer: *mut crfsuite_trainer_t,
data: *const crfsuite_data_t,
filename: *const libc::c_char,
holdout: libc::c_int,
) -> libc::c_int,
>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tag_crfsuite_tagger {
pub internal: *mut libc::c_void,
pub nref: libc::c_int,
pub addref:
::std::option::Option<unsafe extern "C" fn(tagger: *mut crfsuite_tagger_t) -> libc::c_int>,
pub release:
::std::option::Option<unsafe extern "C" fn(tagger: *mut crfsuite_tagger_t) -> libc::c_int>,
pub set: ::std::option::Option<
unsafe extern "C" fn(
tagger: *mut crfsuite_tagger_t,
inst: *mut crfsuite_instance_t,
) -> libc::c_int,
>,
pub length:
::std::option::Option<unsafe extern "C" fn(tagger: *mut crfsuite_tagger_t) -> libc::c_int>,
pub viterbi: ::std::option::Option<
unsafe extern "C" fn(
tagger: *mut crfsuite_tagger_t,
labels: *mut libc::c_int,
ptr_score: *mut floatval_t,
) -> libc::c_int,
>,
pub score: ::std::option::Option<
unsafe extern "C" fn(
tagger: *mut crfsuite_tagger_t,
path: *mut libc::c_int,
ptr_score: *mut floatval_t,
) -> libc::c_int,
>,
pub lognorm: ::std::option::Option<
unsafe extern "C" fn(
tagger: *mut crfsuite_tagger_t,
ptr_norm: *mut floatval_t,
) -> libc::c_int,
>,
pub marginal_point: ::std::option::Option<
unsafe extern "C" fn(
tagger: *mut crfsuite_tagger_t,
l: libc::c_int,
t: libc::c_int,
ptr_prob: *mut floatval_t,
) -> libc::c_int,
>,
pub marginal_path: ::std::option::Option<
unsafe extern "C" fn(
tagger: *mut crfsuite_tagger_t,
path: *const libc::c_int,
begin: libc::c_int,
end: libc::c_int,
ptr_prob: *mut floatval_t,
) -> libc::c_int,
>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tag_crfsuite_dictionary {
pub internal: *mut libc::c_void,
pub nref: libc::c_int,
pub addref:
::std::option::Option<unsafe extern "C" fn(dic: *mut crfsuite_dictionary_t) -> libc::c_int>,
pub release:
::std::option::Option<unsafe extern "C" fn(dic: *mut crfsuite_dictionary_t) -> libc::c_int>,
pub get: ::std::option::Option<
unsafe extern "C" fn(
dic: *mut crfsuite_dictionary_t,
str: *const libc::c_char,
) -> libc::c_int,
>,
pub to_id: ::std::option::Option<
unsafe extern "C" fn(
dic: *mut crfsuite_dictionary_t,
str: *const libc::c_char,
) -> libc::c_int,
>,
pub to_string: ::std::option::Option<
unsafe extern "C" fn(
dic: *mut crfsuite_dictionary_t,
id: libc::c_int,
pstr: *mut *const libc::c_char,
) -> libc::c_int,
>,
pub num:
::std::option::Option<unsafe extern "C" fn(dic: *mut crfsuite_dictionary_t) -> libc::c_int>,
pub free: ::std::option::Option<
unsafe extern "C" fn(dic: *mut crfsuite_dictionary_t, str: *const libc::c_char),
>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tag_crfsuite_params {
pub internal: *mut libc::c_void,
pub nref: libc::c_int,
pub addref:
::std::option::Option<unsafe extern "C" fn(params: *mut crfsuite_params_t) -> libc::c_int>,
pub release:
::std::option::Option<unsafe extern "C" fn(params: *mut crfsuite_params_t) -> libc::c_int>,
pub num:
::std::option::Option<unsafe extern "C" fn(params: *mut crfsuite_params_t) -> libc::c_int>,
pub name: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
i: libc::c_int,
ptr_name: *mut *mut libc::c_char,
) -> libc::c_int,
>,
pub set: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
name: *const libc::c_char,
value: *const libc::c_char,
) -> libc::c_int,
>,
pub get: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
name: *const libc::c_char,
ptr_value: *mut *mut libc::c_char,
) -> libc::c_int,
>,
pub set_int: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
name: *const libc::c_char,
value: libc::c_int,
) -> libc::c_int,
>,
pub set_float: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
name: *const libc::c_char,
value: floatval_t,
) -> libc::c_int,
>,
pub set_string: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
name: *const libc::c_char,
value: *const libc::c_char,
) -> libc::c_int,
>,
pub get_int: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
name: *const libc::c_char,
ptr_value: *mut libc::c_int,
) -> libc::c_int,
>,
pub get_float: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
name: *const libc::c_char,
ptr_value: *mut floatval_t,
) -> libc::c_int,
>,
pub get_string: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
name: *const libc::c_char,
ptr_value: *mut *mut libc::c_char,
) -> libc::c_int,
>,
pub help: ::std::option::Option<
unsafe extern "C" fn(
params: *mut crfsuite_params_t,
name: *const libc::c_char,
ptr_type: *mut *mut libc::c_char,
ptr_help: *mut *mut libc::c_char,
) -> libc::c_int,
>,
pub free: ::std::option::Option<
unsafe extern "C" fn(params: *mut crfsuite_params_t, str: *const libc::c_char),
>,
}
extern "C" {
pub fn crfsuite_create_instance(
iid: *const libc::c_char,
ptr: *mut *mut libc::c_void,
) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_create_instance_from_file(
filename: *const libc::c_char,
ptr: *mut *mut libc::c_void,
) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_create_instance_from_memory(
data: *const libc::c_void,
size: usize,
ptr: *mut *mut libc::c_void,
) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_create_tagger(
filename: *const libc::c_char,
ptr_tagger: *mut *mut crfsuite_tagger_t,
ptr_attrs: *mut *mut crfsuite_dictionary_t,
ptr_labels: *mut *mut crfsuite_dictionary_t,
) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_attribute_init(attr: *mut crfsuite_attribute_t);
}
extern "C" {
pub fn crfsuite_attribute_set(
attr: *mut crfsuite_attribute_t,
aid: libc::c_int,
value: floatval_t,
);
}
extern "C" {
pub fn crfsuite_attribute_copy(
dst: *mut crfsuite_attribute_t,
src: *const crfsuite_attribute_t,
);
}
extern "C" {
pub fn crfsuite_attribute_swap(x: *mut crfsuite_attribute_t, y: *mut crfsuite_attribute_t);
}
extern "C" {
pub fn crfsuite_item_init(item: *mut crfsuite_item_t);
}
extern "C" {
pub fn crfsuite_item_init_n(item: *mut crfsuite_item_t, num_attributes: libc::c_int);
}
extern "C" {
pub fn crfsuite_item_finish(item: *mut crfsuite_item_t);
}
extern "C" {
pub fn crfsuite_item_copy(dst: *mut crfsuite_item_t, src: *const crfsuite_item_t);
}
extern "C" {
pub fn crfsuite_item_swap(x: *mut crfsuite_item_t, y: *mut crfsuite_item_t);
}
extern "C" {
pub fn crfsuite_item_append_attribute(
item: *mut crfsuite_item_t,
attr: *const crfsuite_attribute_t,
) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_item_empty(item: *mut crfsuite_item_t) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_instance_init(seq: *mut crfsuite_instance_t);
}
extern "C" {
pub fn crfsuite_instance_init_n(seq: *mut crfsuite_instance_t, num_items: libc::c_int);
}
extern "C" {
pub fn crfsuite_instance_finish(seq: *mut crfsuite_instance_t);
}
extern "C" {
pub fn crfsuite_instance_copy(dst: *mut crfsuite_instance_t, src: *const crfsuite_instance_t);
}
extern "C" {
pub fn crfsuite_instance_swap(x: *mut crfsuite_instance_t, y: *mut crfsuite_instance_t);
}
extern "C" {
pub fn crfsuite_instance_append(
seq: *mut crfsuite_instance_t,
item: *const crfsuite_item_t,
label: libc::c_int,
) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_instance_empty(seq: *mut crfsuite_instance_t) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_data_init(data: *mut crfsuite_data_t);
}
extern "C" {
pub fn crfsuite_data_init_n(data: *mut crfsuite_data_t, n: libc::c_int);
}
extern "C" {
pub fn crfsuite_data_finish(data: *mut crfsuite_data_t);
}
extern "C" {
pub fn crfsuite_data_copy(dst: *mut crfsuite_data_t, src: *const crfsuite_data_t);
}
extern "C" {
pub fn crfsuite_data_swap(x: *mut crfsuite_data_t, y: *mut crfsuite_data_t);
}
extern "C" {
pub fn crfsuite_data_append(
data: *mut crfsuite_data_t,
inst: *const crfsuite_instance_t,
) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_data_maxlength(data: *mut crfsuite_data_t) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_data_totalitems(data: *mut crfsuite_data_t) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_evaluation_init(eval: *mut crfsuite_evaluation_t, n: libc::c_int);
}
extern "C" {
pub fn crfsuite_evaluation_finish(eval: *mut crfsuite_evaluation_t);
}
extern "C" {
pub fn crfsuite_evaluation_clear(eval: *mut crfsuite_evaluation_t);
}
extern "C" {
pub fn crfsuite_evaluation_accmulate(
eval: *mut crfsuite_evaluation_t,
reference: *const libc::c_int,
prediction: *const libc::c_int,
T: libc::c_int,
) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_evaluation_finalize(eval: *mut crfsuite_evaluation_t);
}
extern "C" {
pub fn crfsuite_evaluation_output(
eval: *mut crfsuite_evaluation_t,
labels: *mut crfsuite_dictionary_t,
cbm: crfsuite_logging_callback,
user: *mut libc::c_void,
);
}
extern "C" {
pub fn crfsuite_interlocked_increment(count: *mut libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn crfsuite_interlocked_decrement(count: *mut libc::c_int) -> libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __va_list_tag {
pub gp_offset: libc::c_uint,
pub fp_offset: libc::c_uint,
pub overflow_arg_area: *mut libc::c_void,
pub reg_save_area: *mut libc::c_void,
}