ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
parser
transition_map.h
Go to the documentation of this file.
1
9
#ifndef META_PARSER_TRANSITION_MAP_H_
10
#define META_PARSER_TRANSITION_MAP_H_
11
12
#include "
parser/transition.h
"
13
#include "
util/sparse_vector.h
"
14
15
namespace
meta
16
{
17
namespace
parser
18
{
19
23
class
transition_map
24
{
25
public
:
29
transition_map
() =
default
;
30
35
transition_map
(
const
std::string& prefix);
36
41
const
transition
&
at
(trans_id
id
)
const
;
42
47
trans_id
at
(
const
transition
& trans)
const
;
48
55
trans_id
operator[]
(
const
transition
& trans);
56
61
void
save
(
const
std::string& prefix)
const
;
62
66
uint64_t
size
()
const
;
67
71
class
exception
:
public
std::runtime_error
72
{
73
public
:
74
using
std::runtime_error::runtime_error;
75
};
76
77
private
:
81
util::sparse_vector<transition, trans_id>
map_
;
82
86
std::vector<transition>
transitions_
;
87
};
88
}
89
}
90
#endif
meta::parser::transition_map::size
uint64_t size() const
Definition:
transition_map.cpp:97
transition.h
meta::parser::transition_map::transitions_
std::vector< transition > transitions_
The "map" from id to transition.
Definition:
transition_map.h:86
meta::parser::transition
Represents a transition taken by the parser.
Definition:
transition.h:27
meta::util::sparse_vector
Represents a sparse vector, indexed by type Index and storing values of type Value.
Definition:
sparse_vector.h:28
meta::parser::transition_map::exception
Exception thrown from interactions with the transition_map.
Definition:
transition_map.h:71
meta
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
meta::parser::transition_map::transition_map
transition_map()=default
Default constructor.
meta::parser::transition_map::operator[]
trans_id operator[](const transition &trans)
Adds a transition to the map, if it doesn't already exist.
Definition:
transition_map.cpp:86
meta::parser::transition_map
An invertible map that maps transitions to ids.
Definition:
transition_map.h:23
meta::parser::transition_map::save
void save(const std::string &prefix) const
Saves the map to a file stored in the folder indicated by prefix.
Definition:
transition_map.cpp:103
meta::parser::transition_map::at
const transition & at(trans_id id) const
Definition:
transition_map.cpp:72
sparse_vector.h
meta::parser::transition_map::map_
util::sparse_vector< transition, trans_id > map_
The map from transition to id.
Definition:
transition_map.h:81
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1