Uses 911K of libraries. Click here for Pure Java version (5825L/28K).
1 | !7 |
2 | |
3 | cmodule WordAutoSplitter {
|
4 | S typingText, text, html; |
5 | |
6 | enhanceFrame { minFrameSize(f, 300, 300); }
|
7 | |
8 | visualize {
|
9 | ret northAndCenterWithMargins(dm_bigInputAndSubmit('typingText, "Split", rThread { setText(typingText) }),
|
10 | fontSizePlus(5, dm_centeredLabel('html)));
|
11 | } |
12 | |
13 | void setText(S text) enter {
|
14 | setField(+text); |
15 | NavigableSet<S> words = asCISet((LS) dm_call(dm_actualWordsCRUD(), 'actualWords)); |
16 | new LS out; |
17 | S s = text; |
18 | for (S part : prefixesInCISet(words, s)) |
19 | out.add(part + " " + unicode_middleDot() + " " + substring(s, l(part))); |
20 | sortByCalculatedFieldDesc_inPlace(out, func(S s) -> bool { contains(words, afterLastSpace(s)) });
|
21 | setField(html := jlabel_textAsHTML_center(lines_rtrim(out)); |
22 | } |
23 | } |
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1021130 |
| Snippet name: | Word Auto-Splitter [splits once] |
| Eternal ID of this version: | #1021130/14 |
| Text MD5: | d75bb0a12b020c9e04411577ae157e74 |
| Transpilation MD5: | c18ef026115583fc550da3fb91237311 |
| Author: | stefan |
| Category: | javax / stefan's os / nlp |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-05-23 16:26:13 |
| Source code size: | 779 bytes / 23 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 591 / 1722 |
| Version history: | 13 change(s) |
| Referenced in: | [show references] |