source: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/org/hathitrust/extractedfeatures/TestWhitelistDictionaryMain.java@ 31199

Last change on this file since 31199 was 31199, checked in by davidb, 7 years ago

Renaming of classname to reflect filename rename

  • Property svn:executable set to *
File size: 1.0 KB
Line 
1package org.hathitrust.extractedfeatures;
2
3
4import java.util.Scanner;
5
6public class TestWhitelistDictionaryMain {
7
8 public static void main(String[] args)
9 {
10 Scanner scan = new Scanner(System.in);
11 System.out.println("Press enter to start:");
12 String wait = scan.nextLine();
13
14 String dictionary_filename = "whitelist-placeholder.txt";
15
16
17 TestWhitelistBloomFilter whitelist = new TestWhitelistBloomFilter(dictionary_filename);
18 //TestWhitelistHashmap whitelist = new TestWhitelistHashmap(dictionary_filename);
19
20 whitelist.storeEntries();
21
22 System.out.println("Enter words to test (enter '.quit' to quit program");
23
24 boolean quit = false;
25 while (!quit) {
26 String test_word = scan.next();
27 boolean might_contain_test = whitelist.contains(test_word);
28 if (test_word.equals(".quit")) {
29 quit = true;
30 }
31 else {
32 System.out.println("Whitelist ["+test_word+"] = " + might_contain_test);
33 }
34 }
35 scan.close();
36 System.out.println("Program ended.");
37 }
38
39}
Note: See TracBrowser for help on using the repository browser.