ROSE  0.9.9.109
Namespaces | Classes | Functions | Variables
Rose::EditDistance Namespace Reference

Description

Edit distance algorithms and analyses.

Namespaces

 LinearEditDistance
 Edit distance for ASTs.
 
 TreeEditDistance
 Analysis to determine how to make one AST look like another.
 

Classes

struct  LevenshteinStack
 

Functions

template<typename T >
size_t damerauLevenshteinDistance (const std::vector< T > &src, const std::vector< T > &tgt)
 Damerau-Levenshtein edit distance. More...
 
void initDiagnostics ()
 Initialize diagnostics. More...
 
template<typename T >
size_t levenshteinDistance (const std::vector< T > &src, const std::vector< T > &tgt)
 Levenshtein edit distance. More...
 

Variables

Sawyer::Message::Facility mlog
 Diagnostic facility for edit distances. More...
 

Function Documentation

template<typename T >
size_t Rose::EditDistance::damerauLevenshteinDistance ( const std::vector< T > &  src,
const std::vector< T > &  tgt 
)

Damerau-Levenshtein edit distance.

Returns the true Damerau-Levenshtein edit distance of vectors with adjacent transpositions. The arguments may be vectors of any type that defines an equality operation.

Definition at line 15 of file DamerauLevenshtein.h.

void Rose::EditDistance::initDiagnostics ( )

Initialize diagnostics.

Called from Rose::Diagnostics::initialize.

template<typename T >
size_t Rose::EditDistance::levenshteinDistance ( const std::vector< T > &  src,
const std::vector< T > &  tgt 
)

Levenshtein edit distance.

Returns the Levenshtein edit distance of the specified vectors. The vectors may contain any type of element as long as they are both the same type and the element types define equality ("==" operator).

Definition at line 38 of file Levenshtein.h.

Referenced by Rose::EditDistance::LinearEditDistance::Analysis< NodeType >::compute().

Variable Documentation

Sawyer::Message::Facility Rose::EditDistance::mlog

Diagnostic facility for edit distances.