Skip to content

ralfebert/SwiftFzfAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftFzfAlgorithm

A Swift port of the FuzzyMatchV1 algorithm from fzf (v0.61.0).

Usage

import SwiftFzfAlgorithm

let (result, positions) = fuzzyMatchV1(
    caseSensitive: false,
    normalize: false,
    text: "Hello World",
    pattern: "hw",
    withPos: true
)

print(result.score)   // match score
print(result.start)   // start index in text
print(result.end)     // end index in text
print(positions ?? []) // matched character positions

License

MIT — see LICENSE. Original algorithm Copyright (c) 2013-2024 Junegunn Choi.

About

A Swift port of the FuzzyMatchV1 algorithm from fzf

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages