Latest 0.2.0
Homepage https://github.com/cunum/fuzzy-search
License MIT
Platforms ios 12.1
Authors

Build Status
CocoaPods Compatible
Platform
License: MIT

Fuzzy Search iOS

Fast, easy to use, lightweight and dependency free fuzzy search library written in swift.

The library uses the Jaro Winkler Similarity Algorithm for finding the closest match to a given term.

Setup with CocoaPods

Add the following Pod to your Podfile:

pod 'FuzzyMatching'

Then run this command:

$ pod install

Now you can import the module in your project:

import FuzzyMatching

Usage

Initialize a searcher with an array of strings

import FuzzyMatching

let searcher = FuzzySearch(data: ["foo", "bar"])

Find the most similar strings in the array for a given string. The first element in the results array is the most similar, the last is the least similar.

let results = searcher.search("fo")

assert(results[0].term == "foo")
assert(results[0].similarity == 0.91111111111111109)

Return 100 similar terms (default count is 10) with at least 0.5 similarity (default similarity threshold is 0):

let results: [(term: String, similarity: Double)] = searcher.search("fo", count: 100, threshold: 0.5) 

Example

SCREEN

License

FuzzySearch is released under the MIT License.

Latest podspec

{
    "name": "FuzzyMatching",
    "version": "0.2.0",
    "summary": "Easy to use, lightweight and dependency free fuzzy-search library written in swift.",
    "description": "The library uses the Jaro Winkler Similarity Algorithm for finding the closest match to a given term.",
    "homepage": "https://github.com/cunum/fuzzy-search",
    "screenshots": "https://github.com/cunum/fuzzy-search/blob/master/screen.png?raw=true",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "cunum": "[email protected]"
    },
    "source": {
        "git": "https://github.com/cunum/fuzzy-search.git",
        "tag": "0.2.0"
    },
    "social_media_url": "https://twitter.com/ChristianMahler",
    "platforms": {
        "ios": "12.1"
    },
    "source_files": "FuzzySearch/*.{swift}",
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This