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

23
LINES

< > BotCompany Repo | #1026484 // ELE: Prefix Suffix Splitter

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 1319K of libraries. Click here for Pure Java version (8795L/45K).

1  
!7
2  
3  
cmodule ELEPrefixSuffixSplitter > DynPrintLog {
4  
  /*transient LS
5  
    prefixes = ll("un", "pre"),
6  
    suffixes = ll("able", "like", "ology", "ing", "y", "ist", "ism");*/
7  
8  
  start {
9  
    dm_onUserUtteranceWithoutMine(input ->
10  
      pnl(transitiveHullIteratorOfFunction(
11  
        s -> stringEmits(r { processInput(s) }), litciset(input))));
12  
  }
13  
  
14  
  void processInput(S input) {
15  
    //print(input);
16  
    for (S s : mL("Common prefixes"))
17  
      if (swic_notSame(input, s) && !isSpace(input.charAt(l(s))))
18  
        emit(joinPairWithSpace(pairOfNFirstAndRest(input, l(s))));
19  
    for (S s : mL("Common suffixes"))
20  
      if (ewic_notSame(input, s) && !isSpace(input.charAt(l(input)-1-l(s))))
21  
        emit(joinPairWithSpace(pairOfRestAndNLast(input, l(s))));
22  
  }
23  
}

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: #1026484
Snippet name: ELE: Prefix Suffix Splitter
Eternal ID of this version: #1026484/14
Text MD5: 061872741433943c63a9cd626520fc30
Transpilation MD5: 7c4ccf0ac77a6183537bf7c7bb632dd9
Author: stefan
Category: javax / ele
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-07 00:01:51
Source code size: 777 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 147 / 5035
Version history: 13 change(s)
Referenced in: [show references]