Skip to content

Commit ff4c5d4

Browse files
committed
docs(fuzzy): add docs for recursive fuzzy function
Signed-off-by: SphericalKat <[email protected]>
1 parent 7a57d1b commit ff4c5d4

File tree

1 file changed

+7
-0
lines changed
  • lib/src/main/kotlin/dev/sphericalkat/sublimefuzzy

1 file changed

+7
-0
lines changed

lib/src/main/kotlin/dev/sphericalkat/sublimefuzzy/Fuzzy.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ object Fuzzy {
66
*
77
* @param pattern the pattern to match
88
* @param str the string to search
9+
* @return A boolean representing the match status
910
*/
1011
fun fuzzyMatchSimple(pattern: String, str: String): Boolean {
1112
var patternIdx = 0
@@ -164,6 +165,12 @@ object Fuzzy {
164165
return Pair(false, outScore)
165166
}
166167

168+
/**
169+
* Performs a fuzzy search to find pattern inside a string
170+
* @param pattern the the pattern to match
171+
* @param str the string to search
172+
* @return a [Pair] containing the match status as a [Boolean] and match score as an [Int]
173+
*/
167174
fun fuzzyMatch(pattern: String, str: String): Pair<Boolean, Int> {
168175
val recursionCount = 0
169176
val recursionLimit = 10

0 commit comments

Comments
 (0)