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

14
LINES

< > BotCompany Repo | #1003510 // GermanDateAdapter

JavaX fragment (include)

1  
sclass GermanDateAdapter extends WordAdapter2 {
2  
  static L<S> months = splitAtSpace("___ Januar Februar März April Mai Juni Juli August September Oktober November Dezember");
3  
4  
  S lookupToken(S s) {
5  
    int i = indexOf(months, s);
6  
    if (i >= 0) pcall {
7  
      S j = lookupToken(str(i));
8  
      //print("Month found! " + s + " => " + i + " => " + j);
9  
      if (nempty(j))
10  
        ret months.get(parseInt(j));
11  
    }
12  
    ret super.lookupToken(s);
13  
  }
14  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1003510
Snippet name: GermanDateAdapter
Eternal ID of this version: #1003510/1
Text MD5: f2898ca427456a23017a3466c26b37e7
Author: stefan
Category: javax / talking robots
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-07-10 14:50:59
Source code size: 463 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 644 / 1595
Referenced in: [show references]