Uses 1059K of libraries. Click here for Pure Java version (11675L/63K).
1 | !7 |
2 | |
3 | sclass Entry {
|
4 | S text, pattern; |
5 | S grouping; |
6 | } |
7 | |
8 | cmodule2 MatchAll > DynObjectTable<Entry> {
|
9 | S refTexts, refPatterns; |
10 | int max = 1000; |
11 | |
12 | visualize {
|
13 | ret northAndCenter(withMargin(makeForm2( |
14 | "Texts (CRUD field reference)" := dm_textField('refTexts),
|
15 | "Patterns (CRUD field reference)" := dm_textField('refPatterns),
|
16 | rThread calc |
17 | )), super.visualize()); |
18 | } |
19 | |
20 | void calc enter {
|
21 | final LS texts = dm_crudCollectField_ref(refTexts); |
22 | final LS patterns = dm_crudCollectField_ref(refPatterns); |
23 | print("Have " + n2(texts, "text") + ", " + n2(patterns, "pattern"));
|
24 | final new L data; |
25 | withCancelPoint(voidfunc(final CancelPoint cp) {
|
26 | for (fS s : texts) |
27 | for (fS pat : patterns) |
28 | flexMatchIC_iterate(pat, s, voidfunc(Matches m) {
|
29 | data.add(nu(Entry, text := s, pattern := pat, grouping := matchedAsteriskPatternToGrouping(pat, m))); |
30 | if (l(data) >= max) cancelTo(cp); |
31 | }); |
32 | }); |
33 | setData(data); |
34 | } |
35 | } |
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1021062 |
| Snippet name: | Match all texts with all patterns |
| Eternal ID of this version: | #1021062/8 |
| Text MD5: | 5dd4a42ad5fce7b1133ed0b37bf1adfb |
| Transpilation MD5: | 35bb386a248a1ea7fdf3fa0b487bb3d8 |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-03-31 13:16:18 |
| Source code size: | 1039 bytes / 35 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 523 / 957 |
| Version history: | 7 change(s) |
| Referenced in: | [show references] |