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

17
LINES

< > BotCompany Repo | #1030083 // MMO2_LinesToPattern

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

Libraryless. Click here for Pure Java version (2828L/18K).

1  
sclass MMO2_LinesToPattern implements IF1<Cl<S>, S> {
2  
  bool forceStartOfLine = true;
3  
  bool forceEndOfLine = true;
4  
  bool allowTypos = true;
5  
  
6  
  public S get(Cl<S> lines) {
7  
    ret mmo2_combineWithOr(lmap postProcess(
8  
      uniquifySortedIC(lmap simplifyUsingParse3(lines))));
9  
  }
10  
  
11  
  S postProcess(S s) {
12  
    if (!allowTypos) s = joinWithSpace(appendToAll("!", parse3C(s)));
13  
    if (forceStartOfLine) s = "^" + s;
14  
    if (forceEndOfLine) s += "$";
15  
    ret s;
16  
  }
17  
}

Author comment

Began life as a copy of #1030081

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030083
Snippet name: MMO2_LinesToPattern
Eternal ID of this version: #1030083/2
Text MD5: 6f70f29d1a58f6155c395f5a03e2965b
Transpilation MD5: 5a2dc850422f7ce0a10fa584cd8e5675
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-06 09:29:37
Source code size: 484 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 206 / 443
Version history: 1 change(s)
Referenced in: [show references]