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

25
LINES

< > BotCompany Repo | #1027460 // Language Detection Regular Expressions CRUD

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

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

!7

concept DetectorEntry {
  S task; // e.g. "English vs German n=1000"
  S regexp;
  S result;
}

cmodule LanguageDetectionRegexps > DynCRUD<DetectorEntry> {
  start {
    indexConceptFieldsCI(DetectorEntry, 'task, DetectorEntry, 'regexp);
  }
  
  // API
  
  void saveResult(S task, S regexp, S result) {
    cset(uniqCI DetectorEntry(+regexp, +task), +result);
  }
  
  // pairs of regexp + result
  LPairS regexpsForTask(S task) {
    ret map(conceptsWhereCI DetectorEntry(+task),
      e -> pair(e.regexp, e.result));
  }
}

Author comment

Began life as a copy of #1027451

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1027460
Snippet name: Language Detection Regular Expressions CRUD
Eternal ID of this version: #1027460/4
Text MD5: 3e655aa2b2d266d346a2e8a222a19e6b
Transpilation MD5: a4e50ff91ace8d0a9fa075103f1eaff9
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-22 14:45:39
Source code size: 554 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 114 / 249
Version history: 3 change(s)
Referenced in: [show references]