static ItIt<S> ai_dropTrailingPhrases(S s, Collection<S> phrases) { final Set<S> set = asCISet(phrases); L<S> tok = javaTokNPunctuation(s); ret notNulls_iterator( mapIterator(allTokSplits_nOnRight_iterator(tok), func(Pair<LS> p) -> S { set.contains(trimJoin(simpleSpaces(p.b))) ? join(p.a) : null })); }
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: | #1018115 |
Snippet name: | ai_dropTrailingPhrases - assumes phrases in list don't have punctuation |
Eternal ID of this version: | #1018115/6 |
Text MD5: | caeead9f551c3b27aa416b69425b2ba6 |
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:11:26 |
Source code size: | 341 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 333 / 374 |
Version history: | 5 change(s) |
Referenced in: | [show references] |