Uses 911K of libraries. Click here for Pure Java version (12176L/63K).
1 | !7 |
2 | |
3 | concept DetectorEntry { |
4 | S task; // e.g. "English vs German n=1000" |
5 | S regexp; |
6 | S result; |
7 | } |
8 | |
9 | cmodule LanguageDetectionRegexps > DynCRUD<DetectorEntry> { |
10 | start { |
11 | indexConceptFieldsCI(DetectorEntry, 'task, DetectorEntry, 'regexp); |
12 | } |
13 | |
14 | // API |
15 | |
16 | void saveResult(S task, S regexp, S result) { |
17 | cset(uniqCI DetectorEntry(+regexp, +task), +result); |
18 | } |
19 | |
20 | // pairs of regexp + result |
21 | LPairS regexpsForTask(S task) { |
22 | ret map(conceptsWhereCI DetectorEntry(+task), |
23 | e -> pair(e.regexp, e.result)); |
24 | } |
25 | } |
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: | 189 / 354 |
Version history: | 3 change(s) |
Referenced in: | [show references] |