This file contains hidden or 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
| type DeliminatedDocument = { | |
| text: string; | |
| separator: "comma" | "tab"; | |
| } | |
| type PlaintextDocument = { | |
| text: string; | |
| } | |
| type WeirdPlaintextDocument = PlaintextDocument & { |
This file contains hidden or 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
| import numpy | |
| def wagner_fisher(s: str, t: str): | |
| """ | |
| Computes the Levenshtein distance between the two strings. Returns a tuple containing | |
| the distance itself and also the entire matrix for further processing. | |
| See: https://en.wikipedia.org/wiki/Wagner%E2%80%93Fischer_algorithm | |
| """ | |
| m, n = len(s), len(t) |