1 | static S upperNgramScoreBySet(int n, S text, Set<S> set1, Set<S> set2, S a, S b) { |
2 | int score = 0; |
3 | for (S s : upperNgrams(n, text)) |
4 | score += zeroOne(set1.contains(s))-zeroOne(set2.contains(s)); |
5 | ret score > 0 ? a : score < 0 ? b : null; |
6 | } |
Began life as a copy of #1014323
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: | #1014330 |
Snippet name: | upperNgramScoreBySet |
Eternal ID of this version: | #1014330/1 |
Text MD5: | 4a6b1fe2ea221f9033c383e89d6ec05e |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-04-20 03:46:10 |
Source code size: | 251 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 350 / 377 |
Referenced in: | [show references] |