---
name: "Text::Levenshtein::Damerau::PP"
section: "3pm"
platform: "linux"
package: "libtext-levenshtein-damerau-perl"
version: "0.41-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Text::Levenshtein::Damerau::PP"
---

# Text::Levenshtein::Damerau::PP(3pm)

Pure Perl Damerau Levenshtein edit distance.

## NAME

Text::Levenshtein::Damerau::PP - Pure Perl Damerau Levenshtein edit distance.

## SYNOPSIS

```
        use Text::Levenshtein::Damerau::PP qw/pp_edistance/;
        print pp_edistance('Neil','Niel');
        # prints 1
```

## DESCRIPTION

Returns the true Damerau Levenshtein edit distance of strings with adjacent transpositions. Pure Perl implementation. Works correctly with utf8.

```
        use Text::Levenshtein::Damerau::PP qw/pp_edistance/;
        use utf8;
        pp_edistance('ⓕⓞⓤⓡ','ⓕⓤⓞⓡ'),
        # prints 1
```

## METHODS

### pp\_edistance

Arguments: source string and target string.

- •

  *OPTIONAL 3rd argument* int (max distance; only return results with `$int` distance or less). 0 = unlimited. Default = 0.

Returns: int that represents the edit distance between the two argument. Stops calculations and returns -1 if max distance is set and reached.

Function to take the edit distance between a source and target string. Contains the actual algorithm implementation.

```
        use Text::Levenshtein::Damerau::PP qw/pp_edistance/;
        print pp_edistance('Neil','Niel');
        # prints 1
        print pp_edistance('Neil','Nielx',1);
        # prints -1
```

## SEE ALSO

- •

  Text::Levenshtein::Damerau

- •

  Text::Levenshtein::Damerau::XS

## BUGS

Please report bugs to:

\<https://rt.cpan.org/Public/Dist/Display.html?Name=Text-Levenshtein-Damerau\>

## AUTHOR

Nick Logan \<*ug@skunkds.com*\>

## LICENSE AND COPYRIGHT

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
