class Libexttextcat::Candidate
Public Instance Methods
Source
static VALUE
rbe_candidate_m_name (VALUE self)
{
const candidate_t *c = rb_check_typeddata (self, &rbe_candidate_type);
/* This can happen when classified as short. */
if (!c->name)
rb_raise (rbe_eError, "invalid candidate");
return rb_str_new_cstr (c->name);
}
This can be fragile when the target source is too short; sometimes raise error and sometimes returns garbage data.
Source
static VALUE
rbe_candidate_m_score (VALUE self)
{
const candidate_t *c = rb_check_typeddata (self, &rbe_candidate_type);
return RB_INT2NUM (c->score);
}