GCC Middle and Back End API Reference
best_match< GOAL_TYPE, CANDIDATE_TYPE > Class Template Reference

#include <spellcheck.h>

Public Types

typedef GOAL_TYPE goal_t
 
typedef CANDIDATE_TYPE candidate_t
 
typedef edit_distance_traits< goal_tgoal_traits
 
typedef edit_distance_traits< candidate_tcandidate_traits
 

Public Member Functions

 best_match (GOAL_TYPE goal, edit_distance_t best_distance_so_far=MAX_EDIT_DISTANCE)
 
void consider (candidate_t candidate)
 
void set_best_so_far (CANDIDATE_TYPE best_candidate, edit_distance_t best_distance, size_t best_candidate_len)
 
edit_distance_t get_cutoff (size_t candidate_len) const
 
candidate_t get_best_meaningful_candidate () const
 
candidate_t blithely_get_best_candidate () const
 
edit_distance_t get_best_distance () const
 
size_t get_best_candidate_length () const
 

Private Attributes

const charm_goal
 
size_t m_goal_len
 
candidate_t m_best_candidate
 
edit_distance_t m_best_distance
 
size_t m_best_candidate_len
 

Detailed Description

template<typename GOAL_TYPE, typename CANDIDATE_TYPE>
class best_match< GOAL_TYPE, CANDIDATE_TYPE >
A type for use when determining the best match against a string,
expressed as a template so that we can match against various
string-like types (const char *, frontend identifiers, and preprocessor
macros).

This type accumulates the best possible match against GOAL_TYPE for
a sequence of elements of CANDIDATE_TYPE, whilst minimizing the
number of calls to get_edit_distance and to
edit_distance_traits<T>::get_length.   

Member Typedef Documentation

◆ candidate_t

◆ candidate_traits

◆ goal_t

◆ goal_traits

Constructor & Destructor Documentation

◆ best_match()

Member Function Documentation

◆ blithely_get_best_candidate()

◆ consider()

◆ get_best_candidate_length()

◆ get_best_distance()

◆ get_best_meaningful_candidate()

◆ get_cutoff()

◆ set_best_so_far()

Field Documentation

◆ m_best_candidate

◆ m_best_candidate_len

◆ m_best_distance

◆ m_goal

◆ m_goal_len


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