Uses 911K of libraries. Click here for Pure Java version (16572L/91K).
1 | !7 |
2 | |
3 | concept WordInfo { |
4 | S word; |
5 | int position; |
6 | S fact, wordType; |
7 | } |
8 | |
9 | cmodule InfoAboutWords > DynCRUD<WordInfo> { |
10 | S text, comment; |
11 | |
12 | visualize as northCenterSouthSections( |
13 | "Input Text" := fontSizeTimes(1.25, dm_centeredTextField('text)), |
14 | "Facts" := super.visualize(), |
15 | "Tell me something about a word:" := dm_textFieldAndSubmit('comment, 'submitComment)); |
16 | |
17 | void submitComment { |
18 | S word = unquote(firstWord(comment)); // magic |
19 | int i = indexOfIC_fullWord(text, word); // magic |
20 | if (i < 0) shit: quote(word) + " not found in sentence"; |
21 | new Matches m; |
22 | if (match_vbar("* is an adjective|* is an adjective here", comment, m)) |
23 | cset(uniq_sync WordInfo(+word, position := i), wordType := "adjective", wordType_info := now()); |
24 | uniq_sync WordInfo(+word, position := i, fact := comment); |
25 | } |
26 | } |
download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1021017 |
Snippet name: | Info about words |
Eternal ID of this version: | #1021017/30 |
Text MD5: | c7638d3a42a20eb97c4cbdc8379d1301 |
Transpilation MD5: | 69797d7858f850dae7c4262b7b943007 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-01-18 04:45:57 |
Source code size: | 902 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 420 / 4395 |
Version history: | 29 change(s) |
Referenced in: | [show references] |