1 | static L<S> dropPunctuationAtEnd_hard(L<S> tok) { |
2 | tok = new ArrayList<S>(tok); |
3 | for (int i = tok.size()-2; i > 0; i -= 2) { |
4 | S t = tok.get(i); |
5 | if (t.length() == 1 && !Character.isLetterOrDigit(t.charAt(0))) { |
6 | tok.remove(i); |
7 | tok.remove(i); |
8 | } else break; |
9 | } |
10 | return tok; |
11 | } |
12 | |
13 | static S dropPunctuationAtEnd_hard(S s) { |
14 | ret join(dropPunctuationAtEnd_hard(nlTok(s))); |
15 | } |
Began life as a copy of #1008344
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1013607 |
Snippet name: | dropPunctuationAtEnd_hard - actually drop all non-letters |
Eternal ID of this version: | #1013607/3 |
Text MD5: | 377ced72c37115cbbded410b5d4700f4 |
Author: | stefan |
Category: | |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-01-11 14:26:49 |
Source code size: | 406 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 285 / 331 |
Version history: | 2 change(s) |
Referenced in: | [show references] |