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

19
LINES

< > BotCompany Repo | #1028749 // nla_simplifyIntroductions

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4949L/31K).

1  
static NLABlock nla_simplifyIntroductions(S text) {
2  
  ret nla_simplifyIntroductions(nla_parse(text));
3  
}
4  
5  
static NLABlock nla_simplifyIntroductions(NLABlock nla) {
6  
  nla_parse(nla);
7  
  for (NLABlock.Line line : nla.introductions()) {
8  
    // simplify introduction
9  
    line.proposition = frag("var *", line.introducedEntity);
10  
    
11  
    // introduce a new proposition
12  
    NLABlock.Line prop = nla.new Line;
13  
    prop.proposition
14  
      // = frag("* is *", line.introducedEntity, line.introducedEntity.firstSynonym());
15  
      = frag("* is " + line.introducedEntity.firstSynonym(), line.introducedEntity);
16  
    nla.parsedLines.add(line.index()+1, prop);
17  
  }
18  
  ret nla;
19  
}

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: #1028749
Snippet name: nla_simplifyIntroductions
Eternal ID of this version: #1028749/8
Text MD5: d21c2b24830fbcc7b2af6221e75448bc
Transpilation MD5: 6e66d1da679b6f50fe9e82a1f1d397f1
Author: stefan
Category: javax / nla
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-07 00:41:53
Source code size: 676 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 228 / 334
Version history: 7 change(s)
Referenced in: [show references]