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

9
LINES

< > BotCompany Repo | #1021254 - ai_countIdenticalWords

JavaX fragment (include)

static int ai_countIdenticalWords(S a, S b) {
  LS tokA = javaTokWithBrackets_cached(a);
  LS tokB = javaTokWithBrackets_cached(b);
  if (l(tokA) != l(tokB)) ret 0;
  int score = 0;
  for (int i = 1; i < l(tokA); i += 2)
    if (eqic(tokA.get(i), tokB.get(i))) ++score;
  ret score;
}

download  show line numbers  debug dex   

Travelled to 3 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1021254
Snippet name: ai_countIdenticalWords
Eternal ID of this version: #1021254/1
Text MD5: 059254b2ba20e291da301c7493b241d8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-06 11:53:30
Source code size: 292 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 72 / 84
Referenced in: [show references]

Formerly at http://tinybrain.de/1021254 & http://1021254.tinybrain.de