1 | static ItIt<S> ai_dropLeadingPhrases(S s, Collection<S> phrases) {
|
2 | final Set<S> set = asCISet(phrases); |
3 | L<S> tok = javaTokNPunctuation(s); |
4 | ret notNulls_iterator( |
5 | mapIterator(allTokSplits_nOnLeft_iterator(tok), |
6 | func(Pair<LS> p) -> S {
|
7 | set.contains(trimJoin(simpleSpaces(p.a))) ? join(p.b) : null |
8 | })); |
9 | } |
Began life as a copy of #1018115
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: | #1018119 |
| Snippet name: | ai_dropLeadingPhrases - assumes phrases in list don't have punctuation |
| Eternal ID of this version: | #1018119/1 |
| Text MD5: | 9230107d5a2d72f8e7617be484ff63cd |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-09-02 14:31:04 |
| Source code size: | 339 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 553 / 584 |
| Referenced in: | [show references] |