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).

!7

p-exp {
  set flag fullPhraseCache_longestPhraseLength_debug.
  new FullPhraseCache cache;
  cache.add("hello world");
  printStruct(cache);
  assertTrueVerbose(fullPhraseCache_contains(cache, "hello world"));
  assertTrueVerbose(fullPhraseCache_contains(cache, "HELLo... world"));
  assertFalseVerbose(fullPhraseCache_contains(cache, "HELLo..."));
  assertFalseVerbose(fullPhraseCache_contains(cache, "world"));
  assertEqualsVerbose(5, fullPhraseCache_longestPhraseLength(cache, "HELLo... world"));
  assertEqualsVerbose(5, fullPhraseCache_longestPhraseLength(cache, "HELLo world yo"));
  assertEqualsVerbose(7, fullPhraseCache_longestPhraseLength(cache, javaTokNPunctuation("yo hello world yo"), 3));
  assertEqualsVerbose(-1, fullPhraseCache_longestPhraseLength(cache, "HELLo"));
  
  cache.add("HELLO");
  assertTrueVerbose(fullPhraseCache_contains(cache, "HELLo..."));
  assertTrueVerbose(fullPhraseCache_contains(cache, "HELLo... world"));

}

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: 210 / 708
Version history: 10 change(s)
Referenced in: [show references]