Class: StrideAlign::LevenshteinScorer
- Inherits:
-
Object
- Object
- StrideAlign::LevenshteinScorer
- Defined in:
- lib/stride_align/batch.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #distance(target, score_cutoff: nil) ⇒ Object
- #distances(targets, score_cutoff: nil) ⇒ Object
-
#initialize(query) ⇒ LevenshteinScorer
constructor
A new instance of LevenshteinScorer.
- #normalized_distance(target, score_cutoff: nil) ⇒ Object
- #normalized_distances(targets, score_cutoff: nil) ⇒ Object
Constructor Details
#initialize(query) ⇒ LevenshteinScorer
Returns a new instance of LevenshteinScorer.
30 31 32 |
# File 'lib/stride_align/batch.rb', line 30 def initialize(query) @query = StrideAlign.__send__(:scalar_query, query) end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
28 29 30 |
# File 'lib/stride_align/batch.rb', line 28 def query @query end |
Instance Method Details
#distance(target, score_cutoff: nil) ⇒ Object
34 35 36 |
# File 'lib/stride_align/batch.rb', line 34 def distance(target, score_cutoff: nil) StrideAlign.levenshtein_score(@query, target, score_cutoff: score_cutoff) end |
#distances(targets, score_cutoff: nil) ⇒ Object
44 45 46 |
# File 'lib/stride_align/batch.rb', line 44 def distances(targets, score_cutoff: nil) StrideAlign.levenshtein_scores(@query, targets, score_cutoff: score_cutoff) end |
#normalized_distance(target, score_cutoff: nil) ⇒ Object
38 39 40 41 42 |
# File 'lib/stride_align/batch.rb', line 38 def normalized_distance(target, score_cutoff: nil) StrideAlign.levenshtein_normalized_score( @query, target, score_cutoff: score_cutoff ) end |
#normalized_distances(targets, score_cutoff: nil) ⇒ Object
48 49 50 51 52 |
# File 'lib/stride_align/batch.rb', line 48 def normalized_distances(targets, score_cutoff: nil) StrideAlign.levenshtein_normalized_scores( @query, targets, score_cutoff: score_cutoff ) end |