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

8
LINES

< > BotCompany Repo | #1023490 // countPosNegAsCIMap

JavaX fragment (include)

1  
static Map<S, PosNegScore> countPosNegAsCIMap(Collection<S> posExamples, Collection<S> negExamples) {
2  
  Map<S, PosNegScore> map = ciMap();
3  
  for unnull (S word : posExamples)
4  
    getOrCreatePosNegScore(map, word).pos++;
5  
  for unnull (S word : negExamples)
6  
    getOrCreatePosNegScore(map, word).neg++;
7  
  ret map;
8  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023490
Snippet name: countPosNegAsCIMap
Eternal ID of this version: #1023490/1
Text MD5: a60f5ece58cf6074155ec8752e7e0cf8
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-25 02:07:13
Source code size: 320 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 213 / 250
Referenced in: [show references]