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

18
LINES

< > BotCompany Repo | #1001036 // LastWordToLower (predictor)

JavaX fragment (include)

1  
static class LastWordToLower extends P {
2  
  S read(S file, L<S> tok) {
3  
    if (tok.size() < 2) return null;
4  
    S t = tok.get(tok.size()-2);
5  
    if (t.length() == 0) return null;
6  
    if (Character.isUpperCase(t.charAt(0)))
7  
      return t.toLowerCase();
8  
    return null;
9  
  }
10  
  
11  
  P derive() {
12  
    return this;
13  
  }
14  
  
15  
  P clear() {
16  
    return this;
17  
  }
18  
}

Author comment

Began life as a copy of #1001035

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001036
Snippet name: LastWordToLower (predictor)
Eternal ID of this version: #1001036/1
Text MD5: 3b7be76e858b5f7e716159c1a9caf803
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-16 21:09:44
Source code size: 370 bytes / 18 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 625 / 837
Referenced in: [show references]