gfsmTrain.h
Go to the documentation of this file.
1 
2 /*=============================================================================*\
3  * File: gfsmTrain.h
4  * Author: Bryan Jurish <moocow.bovine@gmail.com>
5  * Description: finite state machine library
6  *
7  * Copyright (c) 2014 Bryan Jurish.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  *=============================================================================*/
23 
28 #ifndef _GFSM_TRAIN_H
29 #define _GFSM_TRAIN_H
30 
31 #include <gfsmAutomaton.h>
32 #include <gfsmUtils.h>
33 
34 /*======================================================================
35  * Types: train
36  */
38 typedef struct {
42  gboolean bestPathsOnly;
43 
50 
57 
64 
69 
73  guint nweights;
74 
79 
84 
85 } gfsmTrainer;
86 
87 
89 typedef struct gfsmTrainConfig_ {
90  guint32 i;
91  guint32 j;
96 
98 typedef GPtrArray gfsmTrainPath;
99 
100 
101 /*======================================================================
102  * Methods: training: top-level
103  */
104 
105 //------------------------------
112 
113 //------------------------------
117 void gfsm_trainer_free(gfsmTrainer *trainer, gboolean free_fst);
118 
119 //------------------------------
127 gfsmAutomaton* gfsm_trainer_automaton(gfsmTrainer *trainer, gboolean steal);
128 
129 //------------------------------
141 void gfsm_trainer_train(gfsmTrainer *trainer, gfsmLabelVector *input, gfsmLabelVector *output);
142 
143 #endif /* _GFSM_TRAIN_H */