<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>CRF++: /home/taku/proj/crfpp/crfpp.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">CRF++
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">/home/taku/proj/crfpp/crfpp.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="crfpp_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">  CRF++ -- Yet Another CRF toolkit</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment">  $Id: crfpp.h 1592 2007-02-12 09:40:53Z taku $;</span>
<a name="l00005"></a>00005 <span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment">  Copyright(C) 2005-2007 Taku Kudo &lt;taku@chasen.org&gt;</span>
<a name="l00007"></a>00007 <span class="comment">*/</span>
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef CRFPP_CRFPP_H_</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define CRFPP_CRFPP_H_</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="comment">/* C interface  */</span>
<a name="l00012"></a>00012 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#include &lt;cstdio&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#else</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#endif</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a>00018 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00020"></a>00020 <span class="preprocessor">#endif</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="preprocessor">#ifdef _WIN32</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#include &lt;windows.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#  ifdef DLL_EXPORT</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#    define CRFPP_DLL_EXTERN  __declspec(dllexport)</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#    define CRFPP_DLL_CLASS_EXTERN  __declspec(dllexport)</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#  else</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#    define CRFPP_DLL_EXTERN  __declspec(dllimport)</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#  endif</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 <span class="preprocessor">#ifndef CRFPP_DLL_EXTERN</span>
<a name="l00033"></a><a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">00033</a> <span class="preprocessor"></span><span class="preprocessor">#  define CRFPP_DLL_EXTERN extern</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a>00036 <span class="preprocessor">#ifndef CRFPP_DLL_CLASS_EXTERN</span>
<a name="l00037"></a><a class="code" href="crfpp_8h.html#a49e13744ba2b1807bd2f443e7c2c66a3">00037</a> <span class="preprocessor"></span><span class="preprocessor">#  define CRFPP_DLL_CLASS_EXTERN</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="preprocessor">#ifndef SWIG</span>
<a name="l00041"></a><a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">00041</a> <span class="preprocessor"></span>  <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a> <a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>;
<a name="l00042"></a><a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">00042</a>   <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a> <a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a>;
<a name="l00043"></a>00043 
<a name="l00044"></a>00044   <span class="comment">/* C interface */</span>
<a name="l00045"></a>00045   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a>* <a class="code" href="crfpp_8h.html#af65c88cc1000d956816ab53ee47864d8">crfpp_model_new</a>(<span class="keywordtype">int</span>,  <span class="keywordtype">char</span>**);
<a name="l00046"></a>00046   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a>* <a class="code" href="crfpp_8h.html#a096a0ebd4b71c43f425e5dabc16fc9b1">crfpp_model_new2</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>*);
<a name="l00047"></a>00047   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a>* <a class="code" href="crfpp_8h.html#afc0348809a3395237793e610e923ea9d">crfpp_model_from_array_new</a>(<span class="keywordtype">int</span>,  <span class="keywordtype">char</span>**, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>);
<a name="l00048"></a>00048   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a>* <a class="code" href="crfpp_8h.html#a9f44a77529ca6347bc05c17df220c0b3">crfpp_model_from_array_new2</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>*, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>);
<a name="l00049"></a>00049   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *   <a class="code" href="crfpp_8h.html#ae7c83d9260a4238be7c301bae26193a5">crfpp_model_get_template</a>(<a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a>*);
<a name="l00050"></a>00050   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">void</span>           <a class="code" href="crfpp_8h.html#a5aaf3c2a11dc18e44b81f42887abe36f">crfpp_model_destroy</a>(<a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a>*);
<a name="l00051"></a>00051   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *   <a class="code" href="crfpp_8h.html#a6524f43870769fe489604bd964c8076e">crfpp_model_strerror</a>(<a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a> *);
<a name="l00052"></a>00052   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*       <a class="code" href="crfpp_8h.html#ae4e992853ea9b2e0ebcc2ac2490d17ac">crfpp_model_new_tagger</a>(<a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a> *);
<a name="l00053"></a>00053 
<a name="l00054"></a>00054   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>* <a class="code" href="crfpp_8h.html#a47eeae65e19b67575ee7d4337e3cd4cc">crfpp_new</a>(<span class="keywordtype">int</span>,  <span class="keywordtype">char</span>**);
<a name="l00055"></a>00055   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>* <a class="code" href="crfpp_8h.html#ac316670dc1e5b0eb8234897677a106d0">crfpp_new2</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>*);
<a name="l00056"></a>00056   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">void</span>     <a class="code" href="crfpp_8h.html#ada0c189dcb1005259b3264fb209c3200">crfpp_destroy</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00057"></a>00057   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#a8bdbae154d3be8179b94f64e563a352f">crfpp_set_model</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a> *, <a class="code" href="crfpp_8h.html#aa9a0eeaffcccd8bc2bf6e8aac1546641">crfpp_model_t</a> *);
<a name="l00058"></a>00058   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#aa31efaf0f3b5f40fd4f28b1bf82d5f69">crfpp_add2</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> **);
<a name="l00059"></a>00059   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#a1f088bb83e6d45381811ea4642d2da20">crfpp_add</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keyword">const</span> <span class="keywordtype">char</span>*);
<a name="l00060"></a>00060   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">size_t</span>   <a class="code" href="crfpp_8h.html#ab64059a5606297381c64f34456681bfc">crfpp_size</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00061"></a>00061   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">size_t</span>   <a class="code" href="crfpp_8h.html#a4571ede590c1bbbf63a3bd81dc2e40af">crfpp_xsize</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00062"></a>00062   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">size_t</span>   <a class="code" href="crfpp_8h.html#acd3974a71151a3f6a0cd4ddc12c5d3ab">crfpp_dsize</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00063"></a>00063   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">float</span>* <a class="code" href="crfpp_8h.html#a1150d5c6d46a876a75cee41c85fd58fe">crfpp_weight_vector</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00064"></a>00064   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">size_t</span>   <a class="code" href="crfpp_8h.html#a8a31211011b255a77d5124353df027d7">crfpp_result</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>);
<a name="l00065"></a>00065   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">size_t</span>   <a class="code" href="crfpp_8h.html#a0e4f32071bda760f8dee21fe6896160f">crfpp_answer</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>);
<a name="l00066"></a>00066   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">size_t</span>   <a class="code" href="crfpp_8h.html#af03bfbc697ebe02a6af33520b4f00bc9">crfpp_y</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>);
<a name="l00067"></a>00067   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">size_t</span>   <a class="code" href="crfpp_8h.html#a9df5c9b61b09173d16382a71b686878c">crfpp_ysize</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00068"></a>00068   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#abae8663e259f6880ff5cc93e9c2793b4">crfpp_prob</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00069"></a>00069   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#a4171bbea58da7f4dd2736f1146061219">crfpp_prob2</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>);
<a name="l00070"></a>00070   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#affc7ffda4245d788903df38cb6e936c1">crfpp_prob3</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00071"></a>00071   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">void</span>     <a class="code" href="crfpp_8h.html#abc33fae0a94521846141038ea499ce33">crfpp_set_penalty</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a> *, <span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j, <span class="keywordtype">double</span> penalty);
<a name="l00072"></a>00072   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#acdb1e74f5e108410aadd4da8676f015b">crfpp_penalty</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a> *, <span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j);
<a name="l00073"></a>00073   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#ac8341b2ece6eff9d74ccadbfd25d896b">crfpp_alpha</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00074"></a>00074   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#a299db7d1303ce19c502704fe10d4572a">crfpp_beta</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00075"></a>00075   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#a56ce83f63d1d793347258a7bef732f24">crfpp_emisstion_cost</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00076"></a>00076   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#a13f8c29d09051ac3c1655cd07b57f494">crfpp_next_transition_cost</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>,
<a name="l00077"></a>00077                                                        <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00078"></a>00078   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#a997c64c98ca9631394983b023082d1ae">crfpp_prev_transition_cost</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>,
<a name="l00079"></a>00079                                                        <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00080"></a>00080   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#a0ac978c86fedbeec7ddb43a9608f845d">crfpp_best_cost</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00081"></a>00081   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">int</span>* <a class="code" href="crfpp_8h.html#abd3ca40910819acba3d8083740b1a850">crfpp_emittion_vector</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00082"></a>00082   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">int</span>* <a class="code" href="crfpp_8h.html#a19a39a5b6583b3e9269a2c5192818d83">crfpp_next_transition_vector</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>,
<a name="l00083"></a>00083                                                            <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00084"></a>00084   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">int</span>* <a class="code" href="crfpp_8h.html#adc0fb25629038b6f744e005f9b7d7c04">crfpp_prev_transition_vector</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>,
<a name="l00085"></a>00085                                                            <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00086"></a>00086   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">double</span>   <a class="code" href="crfpp_8h.html#a298837d730e31a2f67691b9df47cbe7a">crfpp_Z</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00087"></a>00087   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#a4dc695bf58946c63dfd874bf56c72c92">crfpp_parse</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00088"></a>00088   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#af2bd7c0fe4bf9d6cd51fced4c02dbc68">crfpp_empty</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00089"></a>00089   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#aad280415f96d5b3251337c2d324eb9cc">crfpp_clear</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00090"></a>00090   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#a1cabfc13e32ea0c2fc6d62278e941c27">crfpp_next</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00091"></a>00091   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#ae344d7e5857c8baed9cd2ca1ff166c8f">crfpp_test</a>(<span class="keywordtype">int</span>, <span class="keywordtype">char</span> **);
<a name="l00092"></a>00092   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#afaa9eaea96b3b4cb07494dbdc1826d95">crfpp_test2</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *);
<a name="l00093"></a>00093   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#a3a6ad1fb5f31d9b483cc02c1e3fde825">crfpp_learn</a>(<span class="keywordtype">int</span>, <span class="keywordtype">char</span> **);
<a name="l00094"></a>00094   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">int</span>      <a class="code" href="crfpp_8h.html#abc7553f3cf363416bfb03e06b878b119">crfpp_learn2</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *);
<a name="l00095"></a>00095   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>*  <a class="code" href="crfpp_8h.html#ab9809a67da577a17281bd0de7d2e0820">crfpp_strerror</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00096"></a>00096   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>*  <a class="code" href="crfpp_8h.html#a781e91b694aa9d200883b423c65b2547">crfpp_yname</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>);
<a name="l00097"></a>00097   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>*  <a class="code" href="crfpp_8h.html#a0d4e595c4a711e074f3e202915804eb3">crfpp_y2</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>);
<a name="l00098"></a>00098   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>*  <a class="code" href="crfpp_8h.html#aabf9208da152d75620153ea34a3f8feb">crfpp_x</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>);
<a name="l00099"></a>00099   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>** <a class="code" href="crfpp_8h.html#a6569643c80d2d21967708ea13550669c">crfpp_x2</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">size_t</span>);
<a name="l00100"></a>00100   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>*  <a class="code" href="crfpp_8h.html#ab5abd8020d58e01473c7cd754eab4406">crfpp_parse_tostr</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keyword">const</span> <span class="keywordtype">char</span>*);
<a name="l00101"></a>00101   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>*  <a class="code" href="crfpp_8h.html#a9248ed418cc9634d69766b06acf168af">crfpp_parse_tostr2</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*,
<a name="l00102"></a>00102                                                    <span class="keyword">const</span> <span class="keywordtype">char</span>*, <span class="keywordtype">size_t</span>);
<a name="l00103"></a>00103   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>*  <a class="code" href="crfpp_8h.html#a173f9454c961189bdea1da8d37b68103">crfpp_parse_tostr3</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keyword">const</span> <span class="keywordtype">char</span>*,
<a name="l00104"></a>00104                                                    <span class="keywordtype">size_t</span>, <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>);
<a name="l00105"></a>00105   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>*  <a class="code" href="crfpp_8h.html#aca204ed779752c741b045147be249fdf">crfpp_tostr</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*);
<a name="l00106"></a>00106   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span>*  <a class="code" href="crfpp_8h.html#a6b5ff87ab448e4128aab974f599fc8a8">crfpp_tostr2</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a>*, <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>);
<a name="l00107"></a>00107 
<a name="l00108"></a>00108   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">void</span> <a class="code" href="crfpp_8h.html#ae22f8ef16983820243e0e925c715649c">crfpp_set_vlevel</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a> *, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>);
<a name="l00109"></a>00109   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="crfpp_8h.html#a4120d4de8fdc620ca6472f2aba2f2678">crfpp_vlevel</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a> *);
<a name="l00110"></a>00110   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">void</span> <a class="code" href="crfpp_8h.html#a406e63ff6f4b5214a10a714d9afb7376">crfpp_set_cost_factor</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a> *, <span class="keywordtype">float</span>);
<a name="l00111"></a>00111   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">float</span> <a class="code" href="crfpp_8h.html#ae846df1fd9e207c4fca788c9bc17f1e9">crfpp_cost_factor</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a> *);
<a name="l00112"></a>00112   <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keywordtype">void</span> <a class="code" href="crfpp_8h.html#a1122f31df4d3673108e0757353c38c01">crfpp_set_nbest</a>(<a class="code" href="crfpp_8h.html#a513ea0b9519c24b6c1797d74c2202e51">crfpp_t</a> *, <span class="keywordtype">size_t</span>);
<a name="l00113"></a>00113 <span class="preprocessor">#endif</span>
<a name="l00114"></a>00114 <span class="preprocessor"></span>
<a name="l00115"></a>00115 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span>}
<a name="l00117"></a>00117 <span class="preprocessor">#endif</span>
<a name="l00118"></a>00118 <span class="preprocessor"></span>
<a name="l00119"></a>00119 <span class="comment">/* C++ interface */</span>
<a name="l00120"></a>00120 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span>
<a name="l00122"></a><a class="code" href="namespaceCRFPP.html">00122</a> <span class="keyword">namespace </span>CRFPP {
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 <span class="keyword">class </span><a class="code" href="classCRFPP_1_1Tagger.html">Tagger</a>;
<a name="l00125"></a>00125 
<a name="l00126"></a><a class="code" href="classCRFPP_1_1Model.html">00126</a> <span class="keyword">class </span><a class="code" href="crfpp_8h.html#a49e13744ba2b1807bd2f443e7c2c66a3">CRFPP_DLL_CLASS_EXTERN</a> <a class="code" href="classCRFPP_1_1Model.html">Model</a> {
<a name="l00127"></a>00127  <span class="keyword">public</span>:
<a name="l00128"></a>00128 <span class="preprocessor">#ifndef SWIG</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span>  <span class="comment">// open model with parameters in argv[]</span>
<a name="l00130"></a>00130   <span class="comment">// e.g, argv[] = {&quot;CRF++&quot;, &quot;-m&quot;, &quot;model&quot;, &quot;-v3&quot;};</span>
<a name="l00131"></a>00131   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> open(<span class="keywordtype">int</span> argc,  <span class="keywordtype">char</span>** argv) = 0;
<a name="l00132"></a>00132 
<a name="l00133"></a>00133   <span class="comment">// open model with parameter arg, e.g. arg = &quot;-m model -v3&quot;;</span>
<a name="l00134"></a>00134   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> open(<span class="keyword">const</span> <span class="keywordtype">char</span>* arg) = 0;
<a name="l00135"></a>00135 
<a name="l00136"></a>00136   <span class="comment">// open model with parameters in argv[].</span>
<a name="l00137"></a>00137   <span class="comment">// e.g, argv[] = {&quot;CRF++&quot;, &quot;-v3&quot;};</span>
<a name="l00138"></a>00138   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> openFromArray(<span class="keywordtype">int</span> argc,  <span class="keywordtype">char</span>** argv,
<a name="l00139"></a>00139                              <span class="keyword">const</span> <span class="keywordtype">char</span> *model_buf,
<a name="l00140"></a>00140                              <span class="keywordtype">size_t</span> model_size) = 0;
<a name="l00141"></a>00141 
<a name="l00142"></a>00142   <span class="comment">// open model with parameter arg, e.g. arg = &quot;-m model -v3&quot;;</span>
<a name="l00143"></a>00143   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> openFromArray(<span class="keyword">const</span> <span class="keywordtype">char</span>* arg,
<a name="l00144"></a>00144                              <span class="keyword">const</span> <span class="keywordtype">char</span> *model_buf,
<a name="l00145"></a>00145                              <span class="keywordtype">size_t</span> model_size) = 0;
<a name="l00146"></a>00146 <span class="preprocessor">#endif</span>
<a name="l00147"></a>00147 <span class="preprocessor"></span>  <span class="comment">// return template string embedded in this model file.</span>
<a name="l00148"></a>00148   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *getTemplate() <span class="keyword">const</span> = 0;
<a name="l00149"></a>00149 
<a name="l00150"></a>00150   <span class="comment">// create Tagger object. Returned object shared the same</span>
<a name="l00151"></a>00151   <span class="comment">// model object</span>
<a name="l00152"></a>00152   <span class="keyword">virtual</span> <a class="code" href="classCRFPP_1_1Tagger.html">Tagger</a> *<a class="code" href="namespaceCRFPP.html#a30aed044aeffde3a6ac36db925f2fa90">createTagger</a>() <span class="keyword">const</span> = 0;
<a name="l00153"></a>00153 
<a name="l00154"></a>00154   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* what() = 0;
<a name="l00155"></a>00155 
<a name="l00156"></a><a class="code" href="classCRFPP_1_1Model.html#aeb89e767b60cce4d90512fbb6807d325">00156</a>   <span class="keyword">virtual</span> <a class="code" href="classCRFPP_1_1Model.html#aeb89e767b60cce4d90512fbb6807d325">~Model</a>() {}
<a name="l00157"></a>00157 };
<a name="l00158"></a>00158 
<a name="l00159"></a><a class="code" href="classCRFPP_1_1Tagger.html">00159</a> <span class="keyword">class </span><a class="code" href="crfpp_8h.html#a49e13744ba2b1807bd2f443e7c2c66a3">CRFPP_DLL_CLASS_EXTERN</a> <a class="code" href="classCRFPP_1_1Tagger.html">Tagger</a> {
<a name="l00160"></a>00160  <span class="keyword">public</span>:
<a name="l00161"></a>00161 <span class="preprocessor">#ifndef SWIG</span>
<a name="l00162"></a>00162 <span class="preprocessor"></span>  <span class="comment">// open model with parameters in argv[]</span>
<a name="l00163"></a>00163   <span class="comment">// e.g, argv[] = {&quot;CRF++&quot;, &quot;-m&quot;, &quot;model&quot;, &quot;-v3&quot;};</span>
<a name="l00164"></a>00164   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> open(<span class="keywordtype">int</span> argc,  <span class="keywordtype">char</span>** argv) = 0;
<a name="l00165"></a>00165 
<a name="l00166"></a>00166   <span class="comment">// open model with parameter arg, e.g. arg = &quot;-m model -v3&quot;;</span>
<a name="l00167"></a>00167   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> open(<span class="keyword">const</span> <span class="keywordtype">char</span>* arg) = 0;
<a name="l00168"></a>00168 
<a name="l00169"></a>00169   <span class="comment">// add str[] as tokens to the current context</span>
<a name="l00170"></a>00170   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> add(<span class="keywordtype">size_t</span> size, <span class="keyword">const</span> <span class="keywordtype">char</span> **str) = 0;
<a name="l00171"></a>00171 
<a name="l00172"></a>00172   <span class="comment">// close the current model</span>
<a name="l00173"></a>00173   <span class="keyword">virtual</span> <span class="keywordtype">void</span> close() = 0;
<a name="l00174"></a>00174 
<a name="l00175"></a>00175   <span class="comment">// return parameter vector. the size should be dsize();</span>
<a name="l00176"></a>00176   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">float</span> *weight_vector() <span class="keyword">const</span> = 0;
<a name="l00177"></a>00177 <span class="preprocessor">#endif</span>
<a name="l00178"></a>00178 <span class="preprocessor"></span>
<a name="l00179"></a>00179   <span class="comment">// set Model</span>
<a name="l00180"></a>00180   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_model(<span class="keyword">const</span> <a class="code" href="classCRFPP_1_1Model.html">Model</a> &amp;model) = 0;
<a name="l00181"></a>00181 
<a name="l00182"></a>00182   <span class="comment">// set vlevel</span>
<a name="l00183"></a>00183   <span class="keyword">virtual</span> <span class="keywordtype">void</span> set_vlevel(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> vlevel) = 0;
<a name="l00184"></a>00184 
<a name="l00185"></a>00185   <span class="comment">// get vlevel</span>
<a name="l00186"></a>00186   <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> vlevel() <span class="keyword">const</span> = 0;
<a name="l00187"></a>00187 
<a name="l00188"></a>00188   <span class="comment">// set cost factor</span>
<a name="l00189"></a>00189   <span class="keyword">virtual</span> <span class="keywordtype">void</span> set_cost_factor(<span class="keywordtype">float</span> cost_factor) = 0;
<a name="l00190"></a>00190 
<a name="l00191"></a>00191   <span class="comment">// get cost factor</span>
<a name="l00192"></a>00192   <span class="keyword">virtual</span> <span class="keywordtype">float</span> cost_factor() <span class="keyword">const</span> = 0;
<a name="l00193"></a>00193 
<a name="l00194"></a>00194   <span class="comment">// set nbest</span>
<a name="l00195"></a>00195   <span class="keyword">virtual</span> <span class="keywordtype">void</span> set_nbest(<span class="keywordtype">size_t</span> nbest) = 0;
<a name="l00196"></a>00196 
<a name="l00197"></a>00197   <span class="comment">// get nbest</span>
<a name="l00198"></a>00198   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> nbest() <span class="keyword">const</span> = 0;
<a name="l00199"></a>00199 
<a name="l00200"></a>00200   <span class="comment">// add one line to the current context</span>
<a name="l00201"></a>00201   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> add(<span class="keyword">const</span> <span class="keywordtype">char</span>* str) = 0;
<a name="l00202"></a>00202 
<a name="l00203"></a>00203   <span class="comment">// return size of tokens(lines)</span>
<a name="l00204"></a>00204   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> size() <span class="keyword">const</span> = 0;
<a name="l00205"></a>00205 
<a name="l00206"></a>00206   <span class="comment">// return size of column</span>
<a name="l00207"></a>00207   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> xsize() <span class="keyword">const</span> = 0;
<a name="l00208"></a>00208 
<a name="l00209"></a>00209   <span class="comment">// return size of features</span>
<a name="l00210"></a>00210   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> dsize() <span class="keyword">const</span> = 0;
<a name="l00211"></a>00211 
<a name="l00212"></a>00212   <span class="comment">// return output tag-id of i-th token</span>
<a name="l00213"></a>00213   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> result(<span class="keywordtype">size_t</span> i) <span class="keyword">const</span> = 0;
<a name="l00214"></a>00214 
<a name="l00215"></a>00215   <span class="comment">// return answer tag-id of i-th token if it is available</span>
<a name="l00216"></a>00216   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> answer(<span class="keywordtype">size_t</span> i) <span class="keyword">const</span> = 0;
<a name="l00217"></a>00217 
<a name="l00218"></a>00218   <span class="comment">// alias of result(i)</span>
<a name="l00219"></a>00219   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> y(<span class="keywordtype">size_t</span> i) <span class="keyword">const</span> = 0;
<a name="l00220"></a>00220 
<a name="l00221"></a>00221   <span class="comment">// return output tag of i-th token as string</span>
<a name="l00222"></a>00222   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*   y2(<span class="keywordtype">size_t</span> i) <span class="keyword">const</span> = 0;
<a name="l00223"></a>00223 
<a name="l00224"></a>00224   <span class="comment">// return i-th tag-id as string</span>
<a name="l00225"></a>00225   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*   yname(<span class="keywordtype">size_t</span> i) <span class="keyword">const</span> = 0;
<a name="l00226"></a>00226 
<a name="l00227"></a>00227   <span class="comment">// return token at [i,j] as string(i:token j:column)</span>
<a name="l00228"></a>00228   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*   x(<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) <span class="keyword">const</span> = 0;
<a name="l00229"></a>00229 
<a name="l00230"></a>00230 <span class="preprocessor">#ifndef SWIG</span>
<a name="l00231"></a>00231 <span class="preprocessor"></span>  <span class="comment">// return an array of strings at i-th tokens</span>
<a name="l00232"></a>00232   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>**  x(<span class="keywordtype">size_t</span>) <span class="keyword">const</span> = 0;
<a name="l00233"></a>00233 <span class="preprocessor">#endif</span>
<a name="l00234"></a>00234 <span class="preprocessor"></span>
<a name="l00235"></a>00235   <span class="comment">// return size of output tags</span>
<a name="l00236"></a>00236   <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> ysize() <span class="keyword">const</span> = 0;
<a name="l00237"></a>00237 
<a name="l00238"></a>00238   <span class="comment">// return marginal probability of j-th tag id at i-th token</span>
<a name="l00239"></a>00239   <span class="keyword">virtual</span> <span class="keywordtype">double</span> prob(<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) <span class="keyword">const</span> = 0;
<a name="l00240"></a>00240 
<a name="l00241"></a>00241   <span class="comment">// return marginal probability of output tag at i-th token</span>
<a name="l00242"></a>00242   <span class="comment">// same as prob(i, tagger-&gt;y(i));</span>
<a name="l00243"></a>00243   <span class="keyword">virtual</span> <span class="keywordtype">double</span> prob(<span class="keywordtype">size_t</span> i) <span class="keyword">const</span> = 0;
<a name="l00244"></a>00244 
<a name="l00245"></a>00245   <span class="comment">// return conditional probability of enter output</span>
<a name="l00246"></a>00246   <span class="keyword">virtual</span> <span class="keywordtype">double</span> prob() <span class="keyword">const</span> = 0;
<a name="l00247"></a>00247 
<a name="l00248"></a>00248   <span class="comment">// set token-level penalty. It would be useful for implementing</span>
<a name="l00249"></a>00249   <span class="comment">// Dual decompositon decoding.</span>
<a name="l00250"></a>00250   <span class="comment">// e.g.</span>
<a name="l00251"></a>00251   <span class="comment">// &quot;Dual Decomposition for Parsing with Non-Projective Head Automata&quot;</span>
<a name="l00252"></a>00252   <span class="comment">// Terry Koo Alexander M. Rush Michael Collins Tommi Jaakkola David Sontag</span>
<a name="l00253"></a>00253   <span class="keyword">virtual</span> <span class="keywordtype">void</span> set_penalty(<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j, <span class="keywordtype">double</span> penalty) = 0;
<a name="l00254"></a>00254   <span class="keyword">virtual</span> <span class="keywordtype">double</span> penalty(<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) <span class="keyword">const</span> = 0;
<a name="l00255"></a>00255 
<a name="l00256"></a>00256   <span class="comment">// return forward log-prob of the j-th tag at i-th token</span>
<a name="l00257"></a>00257   <span class="keyword">virtual</span> <span class="keywordtype">double</span> alpha(<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) <span class="keyword">const</span> = 0;
<a name="l00258"></a>00258 
<a name="l00259"></a>00259   <span class="comment">// return backward log-prob of the j-th tag at i-th token</span>
<a name="l00260"></a>00260   <span class="keyword">virtual</span> <span class="keywordtype">double</span> beta(<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) <span class="keyword">const</span> = 0;
<a name="l00261"></a>00261 
<a name="l00262"></a>00262   <span class="comment">// return emission cost of the j-th tag at i-th token</span>
<a name="l00263"></a>00263   <span class="keyword">virtual</span> <span class="keywordtype">double</span> emission_cost(<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) <span class="keyword">const</span> = 0;
<a name="l00264"></a>00264 
<a name="l00265"></a>00265   <span class="comment">// return transition cost of [j-th tag at i-th token] to</span>
<a name="l00266"></a>00266   <span class="comment">// [k-th tag at(i+1)-th token]</span>
<a name="l00267"></a>00267   <span class="keyword">virtual</span> <span class="keywordtype">double</span> next_transition_cost(<span class="keywordtype">size_t</span> i,
<a name="l00268"></a>00268                                       <span class="keywordtype">size_t</span> j, <span class="keywordtype">size_t</span> k) <span class="keyword">const</span> = 0;
<a name="l00269"></a>00269 
<a name="l00270"></a>00270   <span class="comment">// return transition cost of [j-th tag at i-th token] to</span>
<a name="l00271"></a>00271   <span class="comment">// [k-th tag at(i-1)-th token]</span>
<a name="l00272"></a>00272   <span class="keyword">virtual</span> <span class="keywordtype">double</span> prev_transition_cost(<span class="keywordtype">size_t</span> i,
<a name="l00273"></a>00273                                       <span class="keywordtype">size_t</span> j, <span class="keywordtype">size_t</span> k) <span class="keyword">const</span> = 0;
<a name="l00274"></a>00274 
<a name="l00275"></a>00275   <span class="comment">//  return the best accumulative cost to the j-th tag at i-th token</span>
<a name="l00276"></a>00276   <span class="comment">// used in viterbi search</span>
<a name="l00277"></a>00277   <span class="keyword">virtual</span> <span class="keywordtype">double</span> best_cost(<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) <span class="keyword">const</span> = 0;
<a name="l00278"></a>00278 
<a name="l00279"></a>00279 <span class="preprocessor">#ifndef SWIG</span>
<a name="l00280"></a>00280 <span class="preprocessor"></span>  <span class="comment">// return emission feature vector of the j-th tag at i-th token</span>
<a name="l00281"></a>00281   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">int</span>* emission_vector(<span class="keywordtype">size_t</span> i, <span class="keywordtype">size_t</span> j) <span class="keyword">const</span> = 0;
<a name="l00282"></a>00282 
<a name="l00283"></a>00283   <span class="comment">// return transition feature vector of [j-th tag at i-th token] to</span>
<a name="l00284"></a>00284   <span class="comment">// [k-th tag at(i+1)-th token]</span>
<a name="l00285"></a>00285   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">int</span>* next_transition_vector(<span class="keywordtype">size_t</span> i,
<a name="l00286"></a>00286                                             <span class="keywordtype">size_t</span> j, <span class="keywordtype">size_t</span> k) <span class="keyword">const</span> = 0;
<a name="l00287"></a>00287 
<a name="l00288"></a>00288   <span class="comment">// return transition feature vector of [j-th tag at i-th token] to</span>
<a name="l00289"></a>00289   <span class="comment">// [k-th tag at(i-1)-th token]</span>
<a name="l00290"></a>00290   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">int</span>* prev_transition_vector(<span class="keywordtype">size_t</span> i,
<a name="l00291"></a>00291                                             <span class="keywordtype">size_t</span> j, <span class="keywordtype">size_t</span> k) <span class="keyword">const</span> = 0;
<a name="l00292"></a>00292 <span class="preprocessor">#endif</span>
<a name="l00293"></a>00293 <span class="preprocessor"></span>
<a name="l00294"></a>00294   <span class="comment">// normalizing factor(log-prob)</span>
<a name="l00295"></a>00295   <span class="keyword">virtual</span> <span class="keywordtype">double</span> Z() <span class="keyword">const</span> = 0;
<a name="l00296"></a>00296 
<a name="l00297"></a>00297   <span class="comment">// do parse and change the internal status, if failed, returns false</span>
<a name="l00298"></a>00298   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> parse() = 0;
<a name="l00299"></a>00299 
<a name="l00300"></a>00300   <span class="comment">// return true if the context is empty</span>
<a name="l00301"></a>00301   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> empty() <span class="keyword">const</span> = 0;
<a name="l00302"></a>00302 
<a name="l00303"></a>00303   <span class="comment">// clear all context</span>
<a name="l00304"></a>00304   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> clear() = 0;
<a name="l00305"></a>00305 
<a name="l00306"></a>00306   <span class="comment">// change the internal state to output next-optimal output.</span>
<a name="l00307"></a>00307   <span class="comment">// calling it n-th times, can get n-best results,</span>
<a name="l00308"></a>00308   <span class="comment">// Neeed to specify -nN option to use this function, where</span>
<a name="l00309"></a>00309   <span class="comment">// N&gt;=2</span>
<a name="l00310"></a>00310   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> next() = 0;
<a name="l00311"></a>00311 
<a name="l00312"></a>00312   <span class="comment">// parse &#39;str&#39; and return result as string</span>
<a name="l00313"></a>00313   <span class="comment">// &#39;str&#39; must be written in CRF++&#39;s input format</span>
<a name="l00314"></a>00314   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* parse(<span class="keyword">const</span> <span class="keywordtype">char</span>* str) = 0;
<a name="l00315"></a>00315 
<a name="l00316"></a>00316 <span class="preprocessor">#ifndef SWIG</span>
<a name="l00317"></a>00317 <span class="preprocessor"></span>  <span class="comment">// return parsed result as string</span>
<a name="l00318"></a>00318   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* toString() = 0;
<a name="l00319"></a>00319 
<a name="l00320"></a>00320   <span class="comment">// return parsed result as string.</span>
<a name="l00321"></a>00321   <span class="comment">// Result is saved in the buffer &#39;result&#39;, &#39;size&#39; is the</span>
<a name="l00322"></a>00322   <span class="comment">// size of the buffer. if failed, return NULL</span>
<a name="l00323"></a>00323   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* toString(<span class="keywordtype">char</span>* result , <span class="keywordtype">size_t</span> size) = 0;
<a name="l00324"></a>00324 
<a name="l00325"></a>00325   <span class="comment">// parse &#39;str&#39; and return parsed result.</span>
<a name="l00326"></a>00326   <span class="comment">// You don&#39;t need to delete return value, but the buffer</span>
<a name="l00327"></a>00327   <span class="comment">// is rewritten whenever you call parse method.</span>
<a name="l00328"></a>00328   <span class="comment">// if failed, return NULL</span>
<a name="l00329"></a>00329   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* parse(<span class="keyword">const</span> <span class="keywordtype">char</span> *str, <span class="keywordtype">size_t</span> size) = 0;
<a name="l00330"></a>00330 
<a name="l00331"></a>00331   <span class="comment">// parse &#39;str&#39; and return parsed result.</span>
<a name="l00332"></a>00332   <span class="comment">// The result is stored in the buffer &#39;result&#39;.</span>
<a name="l00333"></a>00333   <span class="comment">// &#39;size2&#39; is the size of the buffer. if failed, return NULL</span>
<a name="l00334"></a>00334   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* parse(<span class="keyword">const</span> <span class="keywordtype">char</span> *str, <span class="keywordtype">size_t</span> size1,
<a name="l00335"></a>00335                             <span class="keywordtype">char</span> *result, <span class="keywordtype">size_t</span> size2) = 0;
<a name="l00336"></a>00336 <span class="preprocessor">#endif</span>
<a name="l00337"></a>00337 <span class="preprocessor"></span>  <span class="comment">// return internal error code as string</span>
<a name="l00338"></a>00338   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* what() = 0;
<a name="l00339"></a>00339 
<a name="l00340"></a><a class="code" href="classCRFPP_1_1Tagger.html#a952aec420a7e26c35dc94c47132dd955">00340</a>   <span class="keyword">virtual</span> <a class="code" href="classCRFPP_1_1Tagger.html#a952aec420a7e26c35dc94c47132dd955">~Tagger</a>() {}
<a name="l00341"></a>00341 };
<a name="l00342"></a>00342 
<a name="l00343"></a>00343 <span class="comment">/* factory method */</span>
<a name="l00344"></a>00344 
<a name="l00345"></a>00345 <span class="comment">// create CRFPP::Tagger instance with parameters in argv[]</span>
<a name="l00346"></a>00346 <span class="comment">// e.g, argv[] = {&quot;CRF++&quot;, &quot;-m&quot;, &quot;model&quot;, &quot;-v3&quot;};</span>
<a name="l00347"></a>00347 <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> Tagger *<a class="code" href="namespaceCRFPP.html#a30aed044aeffde3a6ac36db925f2fa90">createTagger</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv);
<a name="l00348"></a>00348 
<a name="l00349"></a>00349 <span class="comment">// create CRFPP::Tagger instance with parameter in arg</span>
<a name="l00350"></a>00350 <span class="comment">// e.g. arg = &quot;-m model -v3&quot;;</span>
<a name="l00351"></a>00351 <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> Tagger *<a class="code" href="namespaceCRFPP.html#a30aed044aeffde3a6ac36db925f2fa90">createTagger</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *arg);
<a name="l00352"></a>00352 
<a name="l00353"></a>00353 <span class="comment">// create CRFPP::Model instance with parameters in argv[]</span>
<a name="l00354"></a>00354 <span class="comment">// e.g, argv[] = {&quot;CRF++&quot;, &quot;-m&quot;, &quot;model&quot;, &quot;-v3&quot;};</span>
<a name="l00355"></a>00355 <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> Model *<a class="code" href="namespaceCRFPP.html#a493eff5ec210b3ef8ae9f07d1034ce13">createModel</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv);
<a name="l00356"></a>00356 
<a name="l00357"></a>00357 <span class="comment">// load model from [buf, buf+size].</span>
<a name="l00358"></a>00358 <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> Model *<a class="code" href="namespaceCRFPP.html#a3b8624723714a43b263001aaed8e9933">createModelFromArray</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv,
<a name="l00359"></a>00359                                              <span class="keyword">const</span> <span class="keywordtype">char</span> *model_buf,
<a name="l00360"></a>00360                                              <span class="keywordtype">size_t</span> model_size);
<a name="l00361"></a>00361 
<a name="l00362"></a>00362 <span class="comment">// create CRFPP::Model instance with parameter in arg</span>
<a name="l00363"></a>00363 <span class="comment">// e.g. arg = &quot;-m model -v3&quot;;</span>
<a name="l00364"></a>00364 <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> Model *<a class="code" href="namespaceCRFPP.html#a493eff5ec210b3ef8ae9f07d1034ce13">createModel</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *arg);
<a name="l00365"></a>00365 
<a name="l00366"></a>00366 <span class="comment">// load model from [buf, buf+size].</span>
<a name="l00367"></a>00367 <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> Model *<a class="code" href="namespaceCRFPP.html#a3b8624723714a43b263001aaed8e9933">createModelFromArray</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *arg,
<a name="l00368"></a>00368                                              <span class="keyword">const</span> <span class="keywordtype">char</span> *model_buf,
<a name="l00369"></a>00369                                              <span class="keywordtype">size_t</span> model_size);
<a name="l00370"></a>00370 
<a name="l00371"></a>00371 <span class="comment">// return error code of createTagger();</span>
<a name="l00372"></a>00372 <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="namespaceCRFPP.html#a4ea358d9f0b666ff13a1553e79a98777">getTaggerError</a>();
<a name="l00373"></a>00373 
<a name="l00374"></a>00374 <span class="comment">// alias of getTaggerError();</span>
<a name="l00375"></a>00375 <a class="code" href="crfpp_8h.html#af734e706ad1a2bd1ffdc92e7dc95201d">CRFPP_DLL_EXTERN</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="namespaceCRFPP.html#a34a14fb0501fec16428b644ef61f3db0">getLastError</a>();
<a name="l00376"></a>00376 }
<a name="l00377"></a>00377 
<a name="l00378"></a>00378 <span class="preprocessor">#endif</span>
<a name="l00379"></a>00379 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Wed Feb 13 2013 00:37:58 for CRF++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>