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

37
LINES

< > BotCompany Repo | #1025819 // Sentence Analysis Spike [dev.]

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

Uses 911K of libraries. Click here for Pure Java version (6342L/33K).

!7

cmodule SentenceAnalysis > DynPrintLog {
  transient new LS analyzers;
  
  start-thread {
    addAll(analyzers,
      f dropLeadingPunctuation,
      f ai_dropFillers);

    new Analyzer().analyze("OTOH, openbot streams from youtube");
  }
  
  class Analyzer {
    new SeenAndQueue<S> seen;
    
    {
      seen.max = 100;
      seen.onAddedToQueue(voidfunc(S s) { print("> " + s); });
    }

    void analyze(S initial) {
      seen.add(initial);
      for (S s : seen) {
        for (O f : analyzers) {
          O result = callF(f, s);
          if (result cast S)
            seen.add(result);
          else if (result cast Iterable)
            seen.addAll(result);
          else if (result != null)
            print("Ignoring result: " + className(result) + " from " + f);
        }
      }
    }
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025819
Snippet name: Sentence Analysis Spike [dev.]
Eternal ID of this version: #1025819/3
Text MD5: a09a5f6fdc524767bb1e168917c66532
Transpilation MD5: 83def1c7410463989caaea0f3f4d0ecc
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-23 13:32:06
Source code size: 854 bytes / 37 lines
Pitched / IR pitched: No / No
Views / Downloads: 185 / 409
Version history: 2 change(s)
Referenced in: [show references]