ModErn Text Analysis
META Enumerates Textual Applications
sequence.h
Go to the documentation of this file.
1 
9 #ifndef META_SEQUENCE_H_
10 #define META_SEQUENCE_H_
11 
12 #include <vector>
13 
14 #include "sequence/observation.h"
15 
16 namespace meta
17 {
18 namespace sequence
19 {
20 
24 class sequence
25 {
26  public:
28  using iterator = std::vector<observation>::iterator;
30  using const_iterator = std::vector<observation>::const_iterator;
32  using size_type = std::vector<observation>::size_type;
33 
38  void add_observation(observation obs);
39 
44  void add_symbol(symbol_t sym);
45 
51  const observation& operator[](size_type idx) const;
52 
59 
63  iterator begin();
64 
68  iterator end();
69 
73  const_iterator begin() const;
74 
78  const_iterator end() const;
79 
83  size_type size() const;
84 
85  private:
87  std::vector<observation> observations_;
88 };
89 }
90 }
91 
92 #endif
void add_symbol(symbol_t sym)
Adds a symbol to the end of the sequence, untagged.
Definition: sequence.cpp:18
std::vector< observation >::iterator iterator
the iterator class over the sequence
Definition: sequence.h:28
Represents a tagged sequence of observations.
Definition: sequence.h:24
size_type size() const
Definition: sequence.cpp:53
const observation & operator[](size_type idx) const
Subscript operator.
Definition: sequence.cpp:23
iterator begin()
Definition: sequence.cpp:33
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition: analyzer.h:24
std::vector< observation >::size_type size_type
the type containing the size for the sequence
Definition: sequence.h:32
Represents an observation in a tagged sequence.
Definition: observation.h:32
std::vector< observation > observations_
the observations in the sequence
Definition: sequence.h:87
void add_observation(observation obs)
Adds an observation to the end of the sequence.
Definition: sequence.cpp:13
iterator end()
Definition: sequence.cpp:38
std::vector< observation >::const_iterator const_iterator
the const_iterator class over the sequence
Definition: sequence.h:30