Robot Framework
robot.utils.recommendations.RecommendationFinder Class Reference

Public Member Functions

def __init__ (self, normalizer=None)
 
def find (self, name, candidates, max_matches=10)
 Return a list of close matches to name from candidates. More...
 
def find_and_format (self, name, candidates, message, max_matches=10, check_missing_argument_separator=False)
 
def format (self, message, recommendations)
 Add recommendations to the given message. More...
 

Public Attributes

 normalizer
 

Private Member Functions

def _calculate_cutoff (self, string, min_cutoff=0.5, max_cutoff=0.85, step=0.03)
 Calculate a cutoff depending on string length. More...
 
def _check_missing_argument_separator (self, name, candidates)
 
def _get_normalized_candidates (self, candidates)
 
def _get_original_candidates (self, norm_matches, norm_candidates)
 

Detailed Description

Definition at line 21 of file recommendations.py.

Constructor & Destructor Documentation

◆ __init__()

def robot.utils.recommendations.RecommendationFinder.__init__ (   self,
  normalizer = None 
)

Definition at line 23 of file recommendations.py.

Member Function Documentation

◆ _calculate_cutoff()

def robot.utils.recommendations.RecommendationFinder._calculate_cutoff (   self,
  string,
  min_cutoff = 0.5,
  max_cutoff = 0.85,
  step = 0.03 
)
private

Calculate a cutoff depending on string length.

    Default values determined by manual tuning until the results "look right".

Definition at line 84 of file recommendations.py.

◆ _check_missing_argument_separator()

def robot.utils.recommendations.RecommendationFinder._check_missing_argument_separator (   self,
  name,
  candidates 
)
private

Definition at line 88 of file recommendations.py.

◆ _get_normalized_candidates()

def robot.utils.recommendations.RecommendationFinder._get_normalized_candidates (   self,
  candidates 
)
private

Definition at line 65 of file recommendations.py.

◆ _get_original_candidates()

def robot.utils.recommendations.RecommendationFinder._get_original_candidates (   self,
  norm_matches,
  norm_candidates 
)
private

Definition at line 72 of file recommendations.py.

◆ find()

def robot.utils.recommendations.RecommendationFinder.find (   self,
  name,
  candidates,
  max_matches = 10 
)

Return a list of close matches to name from candidates.

Definition at line 38 of file recommendations.py.

◆ find_and_format()

def robot.utils.recommendations.RecommendationFinder.find_and_format (   self,
  name,
  candidates,
  message,
  max_matches = 10,
  check_missing_argument_separator = False 
)

Definition at line 26 of file recommendations.py.

◆ format()

def robot.utils.recommendations.RecommendationFinder.format (   self,
  message,
  recommendations 
)

Add recommendations to the given message.

    The recommendation string looks like::

        <message> Did you mean:
            <recommendations[0]>
            <recommendations[1]>
            <recommendations[2]>

Definition at line 58 of file recommendations.py.

Member Data Documentation

◆ normalizer

robot.utils.recommendations.RecommendationFinder.normalizer

Definition at line 24 of file recommendations.py.


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