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

13
LINES

< > BotCompany Repo | #1010906 // learnedFlexMatch - flexMatchIC + learning counterexamples

JavaX fragment (include)

1  
static bool learnedFlexMatch(S pattern, S s) {
2  
  ret learnedFlexMatch(pattern, s, null);
3  
}
4  
5  
static bool learnedFlexMatch(S pattern, S s, Matches m) {
6  
  if (!flexMatchIC(dropPunctuationAtEnd(pattern), dropPunctuationAtEnd(s), m)) false;
7  
  MatchLearner l = uniq(MatchLearner, +pattern);
8  
  S status = l.examples.get(s);
9  
  if (eq(status, 'rejected)) false;
10  
  if (empty(status))
11  
    l.examples.put(s, 'assumed);
12  
  true;
13  
}

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: #1010906
Snippet name: learnedFlexMatch - flexMatchIC + learning counterexamples
Eternal ID of this version: #1010906/8
Text MD5: a833f879fb9b66aed1cfecd5d6fa0714
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-14 13:41:45
Source code size: 428 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 465 / 495
Version history: 7 change(s)
Referenced in: [show references]