mootModelSpec.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) 2012-2014 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: mootModelSpec.h
24  * Author: Bryan Jurish <moocow@cpan.org>
25  * Description:
26  * + moocow's PoS tagger : model specification
27  *--------------------------------------------------------------------------*/
28 
34 #ifndef _moot_MODELSPEC_H
35 #define _moot_MODELSPEC_H
36 
37 #include <string>
38 
39 namespace moot {
40 
41  //============================================================================
45  class mootModelSpec {
46  public:
47  std::string binfile;
48  std::string lexfile;
49  std::string ngfile;
50  std::string lcfile;
51  std::string flafile;
52 
53  public:
54  //----------------------------------------------------------
55  // Constructors etc.
56 
58  mootModelSpec(const std::string &modelname="", bool try_bin=true)
59  : binfile(""), lexfile(""), ngfile(""), lcfile(""), flafile("")
60  { parse(modelname,try_bin); };
61 
63  void clear(void);
64 
66  bool empty(void) const;
67 
69  inline bool isbinary(void) const
70  { return !binfile.empty(); };
71 
76  bool parse(const std::string &modelname, bool try_bin=true);
77  };
78 
79  //============================================================================
80 
81 
82 }; /* namespace moot */
83 
84 #endif /* _moot_MODELSPEC_H */
Definition: mootAssocVector.h:39
bool empty(void) const
bool parse(const std::string &modelname, bool try_bin=true)
std::string flafile
(txt): filename of flavor heuristic file
Definition: mootModelSpec.h:52
mootModelSpec(const std::string &modelname="", bool try_bin=true)
Definition: mootModelSpec.h:59
bool isbinary(void) const
Definition: mootModelSpec.h:70
std::string lcfile
(txt): filename of lexical-class frequency file
Definition: mootModelSpec.h:51
std::string binfile
(bin): filename of binary model; overrides text model options
Definition: mootModelSpec.h:48
std::string lexfile
(txt): filename of lexical frequency file
Definition: mootModelSpec.h:49
std::string ngfile
(txt): filename of n-gram frequency file
Definition: mootModelSpec.h:50