Libraryless. Click here for Pure Java version (4509L/29K).
1 | static PositionalTokenIndex test_PositionalTokenIndex() { |
2 | new PositionalTokenIndex idx; |
3 | idx.addAll(map wordTok(tlft([[ |
4 | you are here |
5 | what is this |
6 | hello world |
7 | hello you |
8 | ]]))); |
9 | printStruct(idx); |
10 | assertEqualsVerbose(ll("you are here"), map join(idx.byToken(0, "you"))); |
11 | // index should preserve original order |
12 | assertEqualsVerbose(ll("hello world", "hello you"), map join(idx.byToken(0, "hello"))); |
13 | assertEqualsVerbose(ll("what is this"), map join(idx.byToken(1, "is"))); |
14 | assertEqualsVerbose(ll(), unnull(map join(idx.byToken(3, "is")))); |
15 | stresstest_PositionalTokenIndex(); |
16 | ret idx; |
17 | } |
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1025689 |
Snippet name: | test_PositionalTokenIndex [OK] |
Eternal ID of this version: | #1025689/6 |
Text MD5: | 328b270c068420defeb81267141462af |
Transpilation MD5: | 06c8d2dfc491c6bad17b683bbdde9a26 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-10-13 22:23:04 |
Source code size: | 633 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 209 / 345 |
Version history: | 5 change(s) |
Referenced in: | [show references] |