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

11
LINES

< > BotCompany Repo | #1021205 // ai_createNounRefMap_1

JavaX fragment (include)

static Map<TokenAndRange> ai_createNounRefMap_1(L<TokenAndRange> tokens, Set<S> pronouns, Set<S> nouns) {
  new Map<TokenAndRange> map;
  TokenAndRange lastNoun = null;
  for (TokenAndRange t : tokens) {
    if (contains(pronouns, uncurly(t.token)))
      mapPut(map, t, lastNoun);
    if (contains(nouns, uncurly(t.token)) || contains(nouns, dropLeadingDollar(t.token)))
      lastNoun = t;
  }
  ret map;
}

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: #1021205
Snippet name: ai_createNounRefMap_1
Eternal ID of this version: #1021205/4
Text MD5: 0f688052c88325b2f9030e799a98de5f
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-09 16:51:04
Source code size: 418 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 284 / 336
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1021313 - ai_createNounRefs_1