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

17
LINES

< > BotCompany Repo | #1018198 // Group simple noun phrases using BU parser [OK]

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

Download Jar. Libraryless. Click here for Pure Java version (10795L/77K).

!7

p-exp {
  S s = "a horse is an animal";
  
  new AI_BottomUpParser1 p;
  p.splitSplittables = false;
  p.productionsText = [[<determiner> + <noun> = <noun>]];
  p.parse(javaTokNPunctuation(s));
  p.printWordsAndGroups();
  for (AI_BottomUpParser1.Word g : p.groups()) {
    //printStruct(subList(p.cnc, g.wordFrom*2+1, g.wordTo*2));
    tokPrepend(p.cnc, g.wordFrom*2+1, "{");
    tokAppend(p.cnc, g.wordTo*2-1, "}");
  }
  print(join(p.cnc));
}

Author comment

Began life as a copy of #1017910

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018198
Snippet name: Group simple noun phrases using BU parser [OK]
Eternal ID of this version: #1018198/5
Text MD5: 14aee4bc063067feb7f34d78cc7de298
Transpilation MD5: de6042c40696599a76bce09a386b9f06
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-09 18:24:22
Source code size: 465 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 282 / 701
Version history: 4 change(s)
Referenced in: [show references]