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

21
LINES

< > BotCompany Repo | #1023530 // WordTokReplacer

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4175L/26K).

1  
sclass WordTokReplacer extends WordTokRule {
2  
  LLS tokReplaced; // multiple tokenized outputs
3  
  
4  
  *(S sentence, S _vars, S replaced) {
5  
    this(sentence, javaTokWithBracketsC(_vars), replaced);
6  
  }
7  
    
8  
  *(S sentence, Collection<S> vars, S replaced) {
9  
    this(sentence, vars, ll(replaced));
10  
  }
11  
  
12  
  *(S sentence, Collection<S> vars, LS replaced_multi) {
13  
    super(sentence, asCISet(vars));
14  
    tokReplaced = map wordTok_noBrackets(replaced_multi);
15  
  }
16  
  
17  
  run {
18  
    for (LS tok : tokReplaced)
19  
      emit(join(replaceCodeTokensUsingMap_curly(tok, map)));
20  
  }
21  
}

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: #1023530
Snippet name: WordTokReplacer
Eternal ID of this version: #1023530/5
Text MD5: f1d1f0accce59be2a345f5d715cf880d
Transpilation MD5: 22e2cdad3ea7e799e568a9ec3956d288
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-08 19:00:06
Source code size: 584 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 316 / 777
Version history: 4 change(s)
Referenced in: [show references]