-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtask6.txt
64 lines (49 loc) · 1.61 KB
/
task6.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Stage 6/6: Search strategies
Description
Now let's Improve your search engine to make it support complex queries containing word sequences and use several strategies that determine how to match data.
Objectives
In this stage, your program should be able to use such searching strategies as ALL, ANY, and NONE.
Take, for example, these six sample lines:
Dwight Joseph [email protected]
Rene Webb [email protected]
Katie Jacobs
Erick Harrington [email protected]
Myrtle Medina
Erick Burgess
If the strategy is ALL, the program should print lines containing all the words from the query.
Query:
Harrington Erick
Result:
Erick Harrington [email protected]
If the strategy is ANY, the program should print the lines containing at least one word from the query.
Query:
Erick Dwight [email protected]
Result:
Erick Harrington [email protected]
Erick Burgess
Dwight Joseph [email protected]
Rene Webb [email protected]
If the strategy is NONE, the program should print lines that do not contain words from the query at all:
Query:
[email protected] ERICK
Result:
Katie Jacobs
Myrtle Medina
Rene Webb [email protected]
All listed operations are implemented in the inverted index. The results should not contain duplicates.
Do not forget to use methods to decompose your program.
Example
The lines that start with > represent the user input. Note that these symbols are not part of the input.
=== Menu ===
1. Find a person
2. Print all persons
0. Exit
> 1
Select a matching strategy: ALL, ANY, NONE
> ANY
Enter a name or email to search all suitable people.
> Katie Erick QQQ
3 persons found:
Katie Jacobs
Erick Harrington [email protected]
Erick Burgess