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

7
LINES

< > BotCompany Repo | #1017459 // ai_guessCategoriesForUnknownWord_weighted

JavaX fragment (include)

static Map<S, Double> ai_guessCategoriesForUnknownWord_weighted(S word) {
  Map<S, Double> map = lithashmap("<noun>" := 0.3, "<verb>" := 0.3, "<adjective>" := 0.2);
  if (ewic(word, "ing")) map.put("<ingform>" := 0.6);
  if (ewic(word, "ly")) map.put("<adverb>" := 0.6);
  if (eqic(word, "ed")) map.put("<past_participle>" := 0.5);
  ret map;
}

Author comment

Began life as a copy of #1017454

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017459
Snippet name: ai_guessCategoriesForUnknownWord_weighted
Eternal ID of this version: #1017459/3
Text MD5: 9ef07a97e528e5234e9a1e00b5be0bc7
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-26 10:32:47
Source code size: 350 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 281 / 321
Version history: 2 change(s)
Referenced in: [show references]