For this article, I've got an example here:
The code given belown is about how to calculate the distance between strings.
(require "nfl/io.nfl") (require "nfl/string.nfl") (print "Please enter a word for calculating distance: ") (let word(readline)) (let Array (list "windows" "ubuntu" "android")) (foreach i in Array (block (let distance (levenshtein word i)) (print distance " for " i "\n") ) )
(require "nfl/string.nfl") (require "nfl/io.nfl")
The code shown above shows how we import a required package. string package is for Levenshtein function, namely it is not "fuzuli" :) io package is for readline.
You can run it by typing:
fuzuli levenshtein.fzl
Screen View |
Screen View |
Here, I actually wanted to show you many things. One of'em was how to get a piece of array with foreach. Other one was the point of this article, Levenshtein function. I hope that was enough and helpful for you!
See you!