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

13
LINES

< > BotCompany Repo | #1021266 // ai_superSimpleVerbCorrector

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

Libraryless. Click here for Pure Java version (10259L/74K).

1  
sS ai_superSimpleVerbCorrector(S s) {
2  
  LS tok = javaTok/*NPunctuation*/(s);
3  
  for (int i = 1; i < l(tok)-2; i += 2) {
4  
    S t = tok.get(i);
5  
    if (mechCISetContains("Plural nouns", t))
6  
      tokReplaceIfNotNull(tok, i+2, mechCIMapGet("Singular verb => Plural", tok.get(i+2)));
7  
    else if (mechCISetContains("Third person singular pronouns", t))
8  
      tokReplaceIfNotNull(tok, i+2, verbToThirdPerson(tok.get(i+2)));
9  
    else if (mechCISetContains("First person nouns", t))
10  
      tokReplaceIfNotNull(tok, i+2, verbFromThirdPerson(tok.get(i+2)));
11  
  }
12  
  ret join(tok);
13  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1021266
Snippet name: ai_superSimpleVerbCorrector
Eternal ID of this version: #1021266/7
Text MD5: c393bf74e3caa05c4b69f18af5361db7
Transpilation MD5: 7ef8aa2bdb5c50302bf732b0fef2b473
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-03 17:14:29
Source code size: 581 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 335 / 451
Version history: 6 change(s)
Referenced in: [show references]