Robot Framework Integrated Development Environment (RIDE)
robotide.lib.robot.utils.recommendations.RecommendationFinder Class Reference

Public Member Functions

def __init__ (self, normalizer=None)
 
def find_recommendations (self, name, candidates, max_matches=10)
 Return a list of close matches to name from candidates. More...
 

Static Public Member Functions

def format_recommendations (msg, recommendations)
 Add recommendations to the given message. More...
 

Public Attributes

 normalizer
 

Private Member Functions

def _calculate_cutoff (self, string, min_cutoff=.5, max_cutoff=.85, step=.03)
 Calculate a cutoff depending on string length. More...
 
def _get_normalized_candidates (self, candidates)
 
def _get_original_candidates (self, norm_candidates, norm_matches)
 

Detailed Description

Definition at line 19 of file recommendations.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 21 of file recommendations.py.

Member Function Documentation

◆ _calculate_cutoff()

def robotide.lib.robot.utils.recommendations.RecommendationFinder._calculate_cutoff (   self,
  string,
  min_cutoff = .5,
  max_cutoff = .85,
  step = .03 
)
private

Calculate a cutoff depending on string length.

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

Definition at line 74 of file recommendations.py.

◆ _get_normalized_candidates()

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

Definition at line 53 of file recommendations.py.

◆ _get_original_candidates()

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

Definition at line 61 of file recommendations.py.

◆ find_recommendations()

def robotide.lib.robot.utils.recommendations.RecommendationFinder.find_recommendations (   self,
  name,
  candidates,
  max_matches = 10 
)

Return a list of close matches to name from candidates.

Definition at line 25 of file recommendations.py.

◆ format_recommendations()

def robotide.lib.robot.utils.recommendations.RecommendationFinder.format_recommendations (   msg,
  recommendations 
)
static

Add recommendations to the given message.

    The recommendation string looks like:
        <msg> Did you mean:
        <recommendations[0]>
        <recommendations[1]>
        <recommendations[2]>

Definition at line 46 of file recommendations.py.

Member Data Documentation

◆ normalizer

robotide.lib.robot.utils.recommendations.RecommendationFinder.normalizer

Definition at line 22 of file recommendations.py.


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