Changeset 38339 in project


Ignore:
Timestamp:
03/24/20 23:24:39 (7 days ago)
Author:
Kon Lovett
Message:

rel 2.0.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/levenshtein

    r38332 r38339  
    8989==== levenshtein-distance/vector*
    9090
    91 <procedure>(levenshtein-distance/vector* SOURCE TARGET [EDIT-OPER ...] [#:elm-eql ELM-EQL] [#:operations? OPERATIONS])</procedure>
     91<procedure>(levenshtein-distance/vector* SOURCE TARGET [EDIT-OPER ...] [#:elm-eql ELM-EQL] [#:operations? OPERATIONS]) -> number (or boolean array)</procedure>
    9292
    9393Calculates the edit distance from the source vector {{SOURCE}} to the target
    94 vector {{TARGET}}. Returns the total edit cost or (values <total edit cost>
    95 <performed operations matrix>).
     94vector {{TARGET}}. Returns {{(values <total edit cost> (or #f <performed
     95operations matrix>))}}.
    9696
    9797; {{SOURCE}} : {{vector}}.
     
    244244
    245245<enscript language=scheme>
    246 
    247246; Instantiate the distance measure algorithm
    248247(import levenshtein-path-iterator)
     
    254253(define iter
    255254  (levenshtein-path-iterator
    256     (fx:levenshtein-distance/vector* "YWCQPGK" "LAWYQQKPGKA" operations: #t))
     255    (let-values (
     256      ((cost pm)
     257        (fx:levenshtein-distance/vector*
     258          (list->vector (string->list "YWCQPGK"))
     259          (list->vector (string->list "LAWYQQKPGKA"))
     260          operations: #t)) )
     261      pm)))
    257262; ignoring interpreter feedback & we know the distance is 6
    258263(define r0 (iter))
     
    266271; r0 now has #f, since the iterator finishes by returning to the initial caller,
    267272; which is the body of '(define r0 (iter))', thus re-binding r0. However, t0 has
    268 ; the original returned value.
     273; the original returned value:
    269274</enscript>
    270275
     
    306311== Version history
    307312
     313; 2.0.1 : Add types, {{levenshtein-distance/vector*}} always returns 2 values.
    308314; 2.0.0 : C5 release.
    309315; 1.0.3 : Added types. Re-flow.
Note: See TracChangeset for help on using the changeset viewer.