LocARNA-1.9.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions
LocARNA::Alphabet< T > Class Template Reference

Specifies an alphabet. More...

#include <alphabet.hh>

List of all members.

Public Types

typedef vec_t::size_type size_type
 size type
typedef size_type index_type
 type of index
typedef T elem_type
 type of an alphabet element
typedef std::vector< T > elem_vector_type
 vector of elements
typedef elem_vector_type::iterator iterator
 iterator over alphabet elements
typedef
elem_vector_type::const_iterator 
const_iterator
 const iterator over alphabet elements

Public Member Functions

 Alphabet ()
 construct empty
 Alphabet (const elem_vector_type &a)
 construct from vector of alphabet elements
 Alphabet (const elem_type *s, int len)
 construct from array of alphabet indices with given length
size_type size () const
 get alphabet size
size_type idx (const elem_type &elem) const
 convert element to index
const elem_typeelem (size_type idx) const
 convert index to element
bool in (const elem_type &elem) const
 test membership in alphabet
const_iterator begin () const
 begin for const iteration over elements
const_iterator end () const
 end for const iteration over elements
iterator begin ()
 begin for iteration over elements
iterator end ()
 end for iteration over elements

Detailed Description

template<class T>
class LocARNA::Alphabet< T >

Specifies an alphabet.

maintain an (ordered) alphabet and offer transformation between elements of alphabet and their indices


Member Function Documentation

template<class T>
const elem_type& LocARNA::Alphabet< T >::elem ( size_type  idx) const

convert index to element

Parameters:
idxindex
Returns:
element with index idx

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends