Uses 911K of libraries. Click here for Pure Java version (16258L/91K).
1 | !7 |
2 | |
3 | concept Translation {
|
4 | S british, american; |
5 | } |
6 | |
7 | compact module BritishToAmerican > DynCRUD<Translation> {
|
8 | S output; |
9 | |
10 | *() { super(Translation); }
|
11 | |
12 | start {
|
13 | dm_onTopInput(voidfunc(S s) {
|
14 | setField(output := nullIfEq(s, translate(s))); |
15 | dm_findAndCallModule("#1020768/TransformedInput", 'addEntry, s, output, programID());
|
16 | }); |
17 | } |
18 | |
19 | visualize {
|
20 | ret centerAndSouth(super.visualize(), |
21 | withMargin(withLabel("Output:", dm_boldFieldLabel('output))));
|
22 | } |
23 | |
24 | // API |
25 | |
26 | SS getTranslationMap() {
|
27 | ret main.<S> mapFromKeyAndValueField(list(Translation), 'british, 'american); |
28 | } |
29 | |
30 | S translate(S s) {
|
31 | ret replaceCodeTokensUsingMap(getTranslationMap(), s); |
32 | } |
33 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1020766 |
| Snippet name: | British To American |
| Eternal ID of this version: | #1020766/7 |
| Text MD5: | 4579330aad1ea48e8a6e780f2003f01d |
| Transpilation MD5: | 2704410c527b587dd362037f293cf0d4 |
| Author: | stefan |
| Category: | javax / stefan's os |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-01-02 00:47:55 |
| Source code size: | 739 bytes / 33 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 744 / 1250 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |