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

27
LINES

< > BotCompany Repo | #1016785 // Smart Answer Machine 1 [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 408K of libraries. Click here for Pure Java version (15277L/105K).

!7

sclass SmartAnswerMachine1 > DynPrintLog {
  transient new CopyOnWriteArrayList<LS> log;
  bool speak = true;
  
  void start {
    // load cat log
    log.addAll(map words(katze_getFullLog()));
    print("Have log entries: " + l(log));
    
    onSpeechRecognized_withoutMyUtterances(voidfunc(S s) { think(s) });
  }
  
  void think(S s) {
    log.add(words(s));
    L<LS> l = ai_applyPrefixPairs(overlappingPairs(log), words(s));
    L<S> candidates = map joinWithSpace(l);
    if (empty(l)) print("\n" + s + " => no candidates\n");
    else {
      print("\n" + s + " => candidates:\n");
      printIndent(lines(candidates));
      if (speak)
        dm_say(first(candidates));
    }
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016785
Snippet name: Smart Answer Machine 1 [Dyn Module]
Eternal ID of this version: #1016785/6
Text MD5: 3229d6823624e3e42eeafcde459ed14f
Transpilation MD5: 17f737895e89b681d2f0b656885e2ee4
Author: stefan
Category: javax / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-03 16:56:10
Source code size: 722 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 461 / 878
Version history: 5 change(s)
Referenced in: [show references]