| 1 | static S wordScoreBySet(S text, Set<S> set1, Set<S> set2, S a, S b) {
 | 
| 2 | int score = 0; | 
| 3 | for (S word : words(text)) | 
| 4 | score += zeroOne(set1.contains(word))-zeroOne(set2.contains(word)); | 
| 5 | ret score > 0 ? a : score < 0 ? b : null; | 
| 6 | } | 
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: | #1014315 | 
| Snippet name: | wordScoreBySet | 
| Eternal ID of this version: | #1014315/1 | 
| Text MD5: | 632836074defb0a1461839569aa6e4a1 | 
| Author: | stefan | 
| Category: | javax | 
| Type: | JavaX fragment (include) | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2018-04-20 02:52:02 | 
| Source code size: | 238 bytes / 6 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 606 / 663 | 
| Referenced in: | [show references] |