wasteAnnotator.h
Go to the documentation of this file.
1 /* -*- Mode: C++; coding: utf-8; c-basic-offset: 2; -*- */
2 /*
3  libmoot : moot part-of-speech tagging library
4  Copyright (C) 2013 by Bryan Jurish <moocow@cpan.org> and Kay-Michael Würzner
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 3 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 
29 #ifndef _WASTE_ANNOTATOR_H
30 #define _WASTE_ANNOTATOR_H
31 
32 #include <mootTokenIO.h> //-- includes TokenLexer -> GenericLexer -> BufferIO -> Utils -> CIO -> IO
33 
34 namespace moot
35 {
36 
37  /*============================================================================
38  * wasteAnnotator
39  */
45  {
46  public:
47  /*--------------------------------------------------------------------
48  * mootWasteAnnotator: Methods
49  */
50  /*------------------------------------------------------------*/
55 
57  virtual ~wasteAnnotator();
59 
60  /*------------------------------------------------------------*/
61 
64 
66  void annotate_token(mootToken& token);
67 
69  };
70 
71  /*============================================================================
72  * wasteAnnotatorWriter
73  */
76  {
77 
78  public:
79  //------------------------------------------------------------
81 
85 
86  public:
87  //------------------------------------------------------------
89 
90 
91  wasteAnnotatorWriter(int fmt=tiofMediumRare, const std::string &name="wasteAnnotatorWriter")
92  : TokenWriter(fmt,name)
93  {};
94 
98 
99  //------------------------------------------------------------
101 
102 
103  virtual void to_mstream(mootio::mostream *mostreamp);
104 
108  virtual void close(void);
110 
111  //------------------------------------------------------------
113 
114  virtual void put_token(const mootToken &token) {
115  _put_token(token);
116  };
117  virtual void put_tokens(const mootSentence &tokens) {
118  _put_tokens(tokens);
119  };
120  virtual void put_sentence(const mootSentence &sentence) {
121  _put_sentence(sentence);
122  };
123  virtual void put_raw_buffer(const char *buf, size_t len) {
124  _put_raw_buffer(buf,len);
125  };
127 
128  //------------------------------------------------------------
130 
131 
132  void to_writer(TokenWriter *sink);
133 
134  void _put_token(const mootToken &token);
135  void _put_tokens(const mootSentence &tokens);
136  void _put_sentence(const mootSentence &sentence);
137  void _put_raw_buffer(const char *buf, size_t len); //-- passed through to sink
139 
140  };
141 } // namespace moot
142 
143 #endif /* _WASTE_ANNOTATOR_H */
Definition: mootAssocVector.h:39
TokenWriter wrapper for wasteAnnotator.
Definition: wasteAnnotator.h:75
wasteAnnotator waw_annotator
Definition: wasteAnnotator.h:82
void annotate_token(mootToken &token)
Sentence-functional annotations for tokens usually not covered by standard morphological analysis...
Definition: wasteAnnotator.h:44
static const int tiofMediumRare
Definition: mootTokenIO.h:73
virtual ~wasteAnnotator()
TokenWriter * waw_sink
Definition: wasteAnnotator.h:83
Abstract base class for output stream wrappers.
Definition: mootIO.h:194
High-level token information object.
Definition: mootToken.h:96
virtual void put_tokens(const mootSentence &tokens)
Definition: wasteAnnotator.h:117
list< mootToken > mootSentence
Definition: mootToken.h:630
Abstract class for token output.
Definition: mootTokenIO.h:700
Abstract and native classes for I/O of moot::mootToken objects.
wasteAnnotatorWriter(int fmt=tiofMediumRare, const std::string &name="wasteAnnotatorWriter")
Definition: wasteAnnotator.h:91
virtual void put_token(const mootToken &token)
Definition: wasteAnnotator.h:114
virtual void put_raw_buffer(const char *buf, size_t len)
Definition: wasteAnnotator.h:123
virtual void put_sentence(const mootSentence &sentence)
Definition: wasteAnnotator.h:120