ModErn Text Analysis
META Enumerates Textual Applications
Public Types | Public Member Functions | Private Attributes | List of all members
meta::sequence::sequence Class Reference

Represents a tagged sequence of observations. More...

#include <sequence.h>

Public Types

using iterator = std::vector< observation >::iterator
 the iterator class over the sequence
 
using const_iterator = std::vector< observation >::const_iterator
 the const_iterator class over the sequence
 
using size_type = std::vector< observation >::size_type
 the type containing the size for the sequence
 

Public Member Functions

void add_observation (observation obs)
 Adds an observation to the end of the sequence. More...
 
void add_symbol (symbol_t sym)
 Adds a symbol to the end of the sequence, untagged. More...
 
const observationoperator[] (size_type idx) const
 Subscript operator. More...
 
observationoperator[] (size_type idx)
 Subscript operator. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
size_type size () const
 

Private Attributes

std::vector< observationobservations_
 the observations in the sequence
 

Detailed Description

Represents a tagged sequence of observations.

Member Function Documentation

void meta::sequence::sequence::add_observation ( observation  obs)

Adds an observation to the end of the sequence.

Parameters
obsThe observation to add
void meta::sequence::sequence::add_symbol ( symbol_t  sym)

Adds a symbol to the end of the sequence, untagged.

Parameters
symThe symbol for the untagged observation to add
const observation & meta::sequence::sequence::operator[] ( size_type  idx) const

Subscript operator.

Parameters
idxThe index to access
Returns
a const-ref to the observation at that index in the sequence
observation & meta::sequence::sequence::operator[] ( size_type  idx)

Subscript operator.

Parameters
idxThe index to access
Returns
a reference to the observation at that index in the sequence
auto meta::sequence::sequence::begin ( )
Returns
an iterator to the beginning of the sequence
auto meta::sequence::sequence::end ( )
Returns
an iterator to the end of the sequence
auto meta::sequence::sequence::begin ( ) const
Returns
a const_iterator to the beginning of the sequence
auto meta::sequence::sequence::end ( ) const
Returns
a const_iterator to the end of the sequence
auto meta::sequence::sequence::size ( ) const
Returns
the number of observations in the sequence

The documentation for this class was generated from the following files: