This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assert <- function(..., msg=NULL) { | |
# Assert that each of the provided expression is true. Otherwise returns a | |
# description of each failed assertion. | |
# | |
# Args: | |
# ...: List of logical assertions | |
# msg: Optional parameter printed when one of the assertions fails. | |
# | |
# Returns: | |
# Nothing if all assertions pass. Otherwise throws an error describing which |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Approximate String Search | |
# ========================= | |
# | |
# Myers, Gene. "A fast bit-vector algorithm for approximate string matching | |
# based on dynamic programming." Journal of the ACM (JACM) 46.3 (1999): 395-415. | |
# | |
""" | |
approx_search(text, query, k) |