Libraryless. Click here for Pure Java version (4149L/25K).
1 | sbool mmo2_matchWithTypos(S pattern, S s, int maxTypos default 1) { |
2 | ret mmo2_matchWithTypos(mmo2_parsePattern(pattern), s, maxTypos); |
3 | } |
4 | |
5 | sbool mmo2_matchWithTypos(MMOPattern pattern, S s, int maxTypos default 1) { |
6 | if (maxTypos == 0) ret mmo2_match(pattern, s); |
7 | Int score = mmo2_levenWithSwapsScore(pattern, s); |
8 | ret score != null && score <= maxTypos; |
9 | } |
Began life as a copy of #1028074
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030322 |
Snippet name: | mmo2_matchWithTypos |
Eternal ID of this version: | #1030322/1 |
Text MD5: | 4b4b4f78c932dcb62c7eb5ad601774e6 |
Transpilation MD5: | ecd59162a4ca96ad191a38c75e3a48b5 |
Author: | stefan |
Category: | javax / phrasecache |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-12-02 17:36:55 |
Source code size: | 368 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 190 / 256 |
Referenced in: | [show references] |