mootEval.h
Go to the documentation of this file.
1 /* -*- Mode: C++ -*- */
2 
3 /*
4  libmoot : moocow's part-of-speech tagging library
5  Copyright (C) 2003-2009 by Bryan Jurish <moocow@cpan.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 3 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library; if not, write to the Free Software
19  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 
22 /*--------------------------------------------------------------------------
23  * File: mootEval.h
24  * Author: Bryan Jurish <moocow@cpan.org>
25  * Description:
26  * + moot PoS tagger : evaluator
27  *--------------------------------------------------------------------------*/
28 
34 #ifndef _moot_EVAL_H
35 #define _moot_EVAL_H
36 
37 #include <mootToken.h>
38 
39 moot_BEGIN_NAMESPACE
40 
41 /*--------------------------------------------------------------------------
42  * mootEval : evaluation class
43  *--------------------------------------------------------------------------*/
44 
46 class mootEval {
47 public:
48 
50  typedef enum {
51  MEF_None = 0x0000,
52  //MEF_SentMismatch = 0x0001, /**< sentence lengths differ */
53  MEF_TokMismatch = 0x0002,
54  MEF_BestMismatch = 0x0004,
55  MEF_EmptyClass1 = 0x0008,
56  MEF_EmptyClass2 = 0x0010,
57  MEF_ImpClass1 = 0x0020,
58  MEF_ImpClass2 = 0x0040,
59  MEF_XImpClass1 = 0x0080,
60  MEF_XImpClass2 = 0x0100
61  } evalStatus;
62 
63 public:
64  int status;
66 public:
67  mootEval(void) : status(MEF_None) {};
68 
70  inline void clear(void) { status = MEF_None; };
71 
77  int compareTokens(const mootToken &tok1, const mootToken &tok2);
78 
80  //list<mootEvalFlag> compareSentences(const mootSentence &sent1, const mootSentence &sent2);
81 
82  /*----------------------------------------------------
83  * Accessors
84  */
86  inline bool isTokenMismatch(void) { return status&MEF_TokMismatch; };
87 
89  inline bool isBestMismatch(void) { return status&MEF_BestMismatch; };
90 
95  inline bool isEmptyClass1(void) { return status&MEF_EmptyClass1; };
96 
101  inline bool isEmptyClass2(void) { return status&MEF_EmptyClass2; };
102 
107  inline bool isImpClass1(void) { return status&MEF_ImpClass1; };
108 
113  inline bool isImpClass2(void) { return status&MEF_ImpClass2; };
114 
119  inline bool isXImpClass1(void) { return status&MEF_XImpClass1; };
120 
125  inline bool isXImpClass2(void) { return status&MEF_XImpClass2; };
126 
127 
128  /*----------------------------------------------------
129  * Stringification
130  */
146  string status_string(void);
147 };
148 
149 
150 moot_END_NAMESPACE
151 
152 #endif /* _moot_EVAL_H */
int status
Definition: mootEval.h:64
Tagger-evaluation utility class.
Definition: mootEval.h:46
classes and utilities for tokens and associated analyses
bool isEmptyClass2(void)
Definition: mootEval.h:101
bool isImpClass2(void)
Definition: mootEval.h:113
bool isXImpClass1(void)
Definition: mootEval.h:119
mootEval(void)
Definition: mootEval.h:67
High-level token information object.
Definition: mootToken.h:96
bool isTokenMismatch(void)
Definition: mootEval.h:86
bool isBestMismatch(void)
Definition: mootEval.h:89
evalStatus
Definition: mootEval.h:50
void clear(void)
Definition: mootEval.h:70
bool isXImpClass2(void)
Definition: mootEval.h:125
bool isImpClass1(void)
Definition: mootEval.h:107
bool isEmptyClass1(void)
Definition: mootEval.h:95