Skip to content
Levenshtein distance package for Pawn.
Pawn
Branch: master
Clone or download
Pull request Compare This branch is 2 commits behind Southclaws:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
.gitattributes
.gitignore
LICENSE
README.md
levenshtein.inc
pawn.json
test.pwn

README.md

levenshtein.inc

https://en.wikipedia.org/wiki/Levenshtein_distance

Usage

Simply add to your pawn.json and include:

{
    "dependencies": ["ScavengeSurvive/levenshtein"]
}

The function levenshtein simply takes two strings and returns a score that indicates the difference.

#include <levenshtein>

main() {
    new difference = levenshtein("these strings are similar, but not the same", "these strings ar similar, but no the same");
    printf("%d", difference);
}

Testing

To test, simply run the package:

sampctl package run

Then connect to localhost:7777.

You can’t perform that action at this time.