Download Jar. Libraryless. Click here for Pure Java version (1217L/9K).
1 | !7 |
2 | |
3 | p {
|
4 | BoyerMooreStringSearch searcher = new("hello");
|
5 | assertEquals(6, searcher.search("el he hello"));
|
6 | assertEquals(-1, searcher.search("el he helo"));
|
7 | |
8 | // try special characters |
9 | searcher = new BoyerMooreStringSearch("x");
|
10 | assertEquals(-1, searcher.search(u_umlaut())); |
11 | assertEquals(-1, searcher.search(unicode_blackRightArrow())); |
12 | |
13 | assertEquals(0, new BoyerMooreStringSearch(unicode_blackRightArrow()).search(unicode_blackRightArrow())); |
14 | print("OK");
|
15 | } |
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: | #1013281 |
| Snippet name: | Test BoyerMooreStringSearch (OK) |
| Eternal ID of this version: | #1013281/6 |
| Text MD5: | e7d8b7a1c516b42c795bed55f2948a52 |
| Transpilation MD5: | 0b1384514c75ea422567e4054030fbb4 |
| Author: | stefan |
| Category: | javax / string searching |
| Type: | JavaX source code (desktop) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-12-31 08:27:19 |
| Source code size: | 491 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 742 / 1724 |
| Version history: | 5 change(s) |
| Referenced in: | [show references] |