Manual Reference Pages  - edit_distance (3m_strings)

NAME

edit_distance(3f) - [M_strings:DESCRIBE] returns a naive edit distance using the Levenshtein distance algorithm (LICENSE:PD)

CONTENTS

Synopsis
Description
Examples
Author
License

SYNOPSIS

pure elemental function edit_distance(str1,str2) result (distance)

    character(len=*),intent(in)   :: str1, str2
    integer :: distance

DESCRIPTION

The Levenshtein distance function returns how many edits (deletions, insertions, transposition) are required to turn one string into another.

EXAMPLES

Sample Program:

   program demo_edit_distance
   use M_strings, only : edit_distance
      write(*,*)edit_distance(’kittens’,’sitting’)==3
      write(*,*)edit_distance(’geek’,’gesek’)==1
      write(*,*)edit_distance(’Saturday’,’Sunday’)==3
   end program demo_edit_distance

Expected output

    > T
    > T
    > T

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 edit_distance (3m_strings) July 20, 2024
Generated by manServer 1.08 from ab654a3d-a22a-4fda-82be-2bc6e83271ab using man macros.