Libraryless. Click here for Pure Java version (2299L/14K).
1 | sS ai_makeNGramScorer(Cl<S> pos, Cl<S> neg) { |
2 | Set<S> common = setIntersection(asSet(pos), neg); |
3 | pos = listMinusSet(pos, common); |
4 | neg = listMinusSet(neg, common); |
5 | S s = join("|", pos); |
6 | if (nempty(neg)) s += "^" + join("|", neg); |
7 | ret s; |
8 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027500 |
Snippet name: | ai_makeNGramScorer |
Eternal ID of this version: | #1027500/5 |
Text MD5: | 631fee46d3fab3b60e1895b438bd0592 |
Transpilation MD5: | 3e6858a3b71a7068be50444633276be0 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-03-22 16:23:51 |
Source code size: | 255 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 188 / 274 |
Version history: | 4 change(s) |
Referenced in: | [show references] |