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

25
LINES

< > BotCompany Repo | #1008693 // Copy sentences DB [OK]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (7367L/49K/164K).

1  
!7
2  
3  
concept Sentence {
4  
  S text;
5  
  S action; // subject
6  
  S verb;
7  
  new SS data;
8  
}
9  
10  
p {
11  
  Concepts in = new Concepts(#1008607).load();
12  
  Concepts out = new Concepts(#1008692);
13  
  out.persist();
14  
  clearConcepts(out);
15  
  for (Sentence s : list(in, Sentence)) {
16  
    SS data = lithashmap(
17  
      subject := dropPrefix("subject=", s.action),
18  
      verb := dropPrefix("verb=", s.verb));
19  
    Sentence s2 = cnew(out, Sentence, text := s.text, +data);
20  
    if (nempty(data)) {
21  
      print(quote(s.text) + " => " + struct(data));
22  
      printConcept(s2);
23  
    }
24  
  }
25  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008693
Snippet name: Copy sentences DB [OK]
Eternal ID of this version: #1008693/8
Text MD5: f77a4818f72458aa402b62108a0db4f4
Transpilation MD5: b77209d385aadcc69005bf51d0a064be
Author: stefan
Category: javax / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-28 19:27:55
Source code size: 575 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 494 / 642
Version history: 7 change(s)
Referenced in: [show references]