Libraryless. Click here for Pure Java version (4340L/28K).
1 | static L<Proposition> ai_misrecognitionCandidates3() {
|
2 | S text = lines(ai_misrecognitionCandidates2()); |
3 | L<Proposition> l = ai_parseStatementsWithReasoning(text); |
4 | new Matches m; |
5 | new Map<Pair, Int> scored; |
6 | for (Proposition p : l) |
7 | if (match("* is usually a misrecognition of *", p!, m)) {
|
8 | S a = $1, b = $2; |
9 | continue if eqic(a, b); |
10 | scored.put(pair(a, b), levenIC(a, b)); |
11 | } |
12 | |
13 | ret map(mapSortedByValue(scored), (pair, distance) -> withReasoning( |
14 | format_quoteAll("* is usually a misrecognition of *", pair.a, pair.b),
|
15 | "Levenshtein distance is " + distance + " of " + max(l(pair.a), l(pair.b)) |
16 | )); |
17 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1026734 |
| Snippet name: | ai_misrecognitionCandidates3 (sorted by Levenshtein distance) |
| Eternal ID of this version: | #1026734/2 |
| Text MD5: | e8f65ac3ad1216ca9182f3d21cb9aa3c |
| Transpilation MD5: | 796d27ad87f533d38638cf13e735a78a |
| Author: | stefan |
| Category: | javax / ele |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-01-20 00:19:10 |
| Source code size: | 663 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 414 / 513 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |