Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

32
LINES

< > BotCompany Repo | #1001206 // Translator Runner Bot

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1716L/12K/39K).

1  
!747
2  
3  
m {
4  
  p {
5  
    makeAndroid("Translator Runner Bot.");
6  
  }
7  
  
8  
  static synchronized S answer(S s) ctex {
9  
    new Matches m;
10  
    
11  
    if (match3("please run translator * on this text: *", s, m)) {
12  
      S translatorID = unquote(m.m[0]);
13  
      S text = unquote(m.m[1]);
14  
      S result = runTranslator(text, translatorID);
15  
      return "Result: " + stringOut(result);
16  
    }
17  
    
18  
    if (match3("please run translator * on snippet *", s, m)) {
19  
      S translatorID = unquote(m.m[0]);
20  
      S textID = unquote(m.m[1]);
21  
      S text = loadSnippet(textID);
22  
      S result = runTranslator(text, translatorID);
23  
      return "Input: " + stringOut(text) + ", result: " + stringOut(result);
24  
    }
25  
    
26  
    return null;
27  
  }
28  
  
29  
  static synchronized S stringOut(S s) {
30  
    return quote(s);
31  
  }
32  
}

Author comment

Removed the "long strings" mechanism.

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001206
Snippet name: Translator Runner Bot
Eternal ID of this version: #1001206/1
Text MD5: 36af683684afd77faa0e2b44c1d25965
Transpilation MD5: 7d130df7f5c67c67da046c636f818f70
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-11-16 21:30:40
Source code size: 816 bytes / 32 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 572 / 816
Referenced in: [show references]