Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

21
LINES

< > BotCompany Repo | #1022304 // Test FullPhraseCache [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (7416L/53K).

1  
!7
2  
3  
p-exp {
4  
  set flag fullPhraseCache_longestPhraseLength_debug.
5  
  new FullPhraseCache cache;
6  
  cache.add("hello world");
7  
  printStruct(cache);
8  
  assertTrueVerbose(fullPhraseCache_contains(cache, "hello world"));
9  
  assertTrueVerbose(fullPhraseCache_contains(cache, "HELLo... world"));
10  
  assertFalseVerbose(fullPhraseCache_contains(cache, "HELLo..."));
11  
  assertFalseVerbose(fullPhraseCache_contains(cache, "world"));
12  
  assertEqualsVerbose(5, fullPhraseCache_longestPhraseLength(cache, "HELLo... world"));
13  
  assertEqualsVerbose(5, fullPhraseCache_longestPhraseLength(cache, "HELLo world yo"));
14  
  assertEqualsVerbose(7, fullPhraseCache_longestPhraseLength(cache, javaTokNPunctuation("yo hello world yo"), 3));
15  
  assertEqualsVerbose(-1, fullPhraseCache_longestPhraseLength(cache, "HELLo"));
16  
  
17  
  cache.add("HELLO");
18  
  assertTrueVerbose(fullPhraseCache_contains(cache, "HELLo..."));
19  
  assertTrueVerbose(fullPhraseCache_contains(cache, "HELLo... world"));
20  
21  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022304
Snippet name: Test FullPhraseCache [OK]
Eternal ID of this version: #1022304/11
Text MD5: dc04b3d4b8f5943dc3fc16d957194a7c
Transpilation MD5: 454c3bc2756c01235e3bafe2e45f4d03
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-13 05:38:15
Source code size: 973 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 335 / 1006
Version history: 10 change(s)
Referenced in: [show references]