forked from nus-cs2103-AY1718S2/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from tanhengyeow/v1.5-documentation
v1.5-documentation
- Loading branch information
Showing
11 changed files
with
8,894 additions
and
8,087 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -509,12 +509,12 @@ The execution of the find command comprises the following steps: | |
The following code snippets show how methods `formOrPredicate` and `formAndPredicate` are implemented: | ||
[source,java] | ||
---- | ||
public static Predicate<Person> formOrPredicate(Predicate<Person>... predicates) { | ||
public final Predicate<Person> formOrPredicate(Predicate<Person>... predicates) { | ||
return Stream.of(predicates).filter(Objects::nonNull) | ||
.reduce(condition -> false, Predicate::or); | ||
} | ||
public static Predicate<Person> formAndPredicate(Predicate<Person>... predicates) { | ||
public final Predicate<Person> formAndPredicate(Predicate<Person>... predicates) { | ||
return Stream.of(predicates).filter(Objects::nonNull) | ||
.reduce(condition -> true, Predicate::and); | ||
} | ||
|
@@ -537,9 +537,9 @@ Figure 3.4.1.5 Activity diagram when user executes `find` command | |
|
||
==== Aspect: Implementation of find command | ||
|
||
* *Alternative 1 (current choice)*: Each field has its own field predicate composing of the predicates corresponding to the search pattern. The AllPredicate class is used to manage all these field predicates. | ||
* *Alternative 1 (current choice)*: Each field has its own field predicate composing of the predicates corresponding to the search pattern. The `AllPredicate` class is used to manage all these field predicates. | ||
|
||
** Pros: It is easy for new developers to understand. New developers can test each predicate easily, resulting in the debugging process to be smoother. They can also add or remove new predicates of each field easily as all predicates all grouped separately. This choice also adheres to Single Responsibility Principle and (SRP) and Separation of Concerns (SoC). | ||
** Pros: It is easy for new developers to understand. New developers can test each predicate easily, resulting in the debugging process to be smoother. They can also add or remove new predicates of each field easily as all predicates all grouped separately. This choice also adheres to Single Responsibility Principle (SRP) and Separation of Concerns (SoC). | ||
|
||
** Cons: It results in a lot of classes to be created. Although there is increased cohesion, there is also increased coupling. Furthermore, this choice also violates Open-Closed Principle (OCP). | ||
|
||
|
@@ -1717,3 +1717,12 @@ Scheduling an interview for a student | |
.. Command: `filter y/2019 r/3.5-4.5` + | ||
Expected: The student list now only contains students with 2019 as their expected graduation year and with overall rating score between 3.5 to 4.5, inclusive. | ||
|
||
=== Finding every field of the student | ||
. Finding the list of students with **any** fields that match the search keyword according to the search support stated in the User Guide. | ||
.. Command `find bernice, charlot` + | ||
Expected: The student list now displays students `Bernice Yu` and `Charlotte Oliveiro` with reference to the sample data provided. | ||
|
||
=== Finding specific field of the student | ||
. Finding the list of students with **chosen** fields that match the search keyword according to the search support stated in the User Guide. | ||
.. Command `find e/[email protected], [email protected] j/Software p/87438807` + | ||
Expected: The student list now displays student `Alex Yeoh` with reference to the sample data provided. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -282,7 +282,7 @@ These are the prefixes supported by the `find` command: + | |
1. Name - `n/` + | ||
2. Phone - `p/` + | ||
3. Email - `e/` + | ||
4. Address - `n/` + | ||
4. Address - `a/` + | ||
5. University - `u/` + | ||
6. Major - `m/` + | ||
7. Job Applied - `j/` + | ||
|
@@ -292,7 +292,7 @@ These are 3 types of features that are supported for the `find` command: + | |
1. Exact keyword match - Matches your search keyword with exact keywords found in the fields of persons. + | ||
2. Fuzzy keyword match - Matches your search keyword that is a fuzzy match with keywords found in the fields of persons. The fuzzy matching algorithm is based on the Levenshtein distance (LD) , which is a measure of the similarity between two strings. The threshold is set to 2 in HR+. This means that any keyword that is 2 characters different from the search keyword will be detected. If you are interested in finding out how the fuzzy match algorithm works, you can refer to the Java documentation on how this feature is implemented. | ||
2. Fuzzy keyword match - Matches your search keyword that is a fuzzy match with keywords found in the fields of persons. The fuzzy matching algorithm is based on the `Levenshtein distance (LD)` , which is a measure of the similarity between two strings. The threshold is set to `2` in HR+. This means that any keyword that is 2 characters different from the search keyword will be detected. If you are interested in finding out how the fuzzy match algorithm works, you can refer to the Java API on how this method is implemented. | ||
3. Wildcard keyword match – Matches your search keyword with 3 types of wildcard support. You should substitute the keyword " example " with your desired keyword. + | ||
• Wildcard "example" searches for field that contains keyword example | ||
|
@@ -306,20 +306,20 @@ Search results are displayed in the application console. The format is: + | |
(PREFIX) - represents which field the matched keyword was in. + | ||
**** | ||
|
||
The fuzzy search algorithm is implemented to cater users that fits the following profile: + | ||
The fuzzy search algorithm is implemented to cater to users that fit the following profiles: + | ||
1. Unsure what they want to search for + | ||
2. Aware of some patterns of the keywords but not the full keyword + | ||
3. Prone to typos + | ||
|
||
If you are certain that you want to find a certain keyword, please use the wildcard `"example"` so that all fields that contains the search keyword would be displayed only. Customizing fuzzy searching is one of our considerations for v2.0. | ||
If you are certain that you want to find a certain keyword, please use the wildcard `"example"` so that all fields that contains the search keyword would be displayed only. Customizing fuzzy searching is one of our considerations for `v2.0`. | ||
|
||
Examples: + | ||
|
||
[TIP] | ||
General tips are not repeated across different examples! | ||
|
||
* `find bernice, charlot` + | ||
Returns list of persons whose keywords in **any** of their fields that are of an exact match **OR** fuzzy match with `bernice` **OR** `charlot`. In the sample data provided, the list will return persons `Bernice Yu` and `Charlotte Oliveiro`. Keyword `bernice` is an exact match with one of the keywords `Bernice` and `charlot` is a fuzzy match with one of the keywords `Charlotte` in `Charlotte Oliveiro`. | ||
Returns list of persons whose keywords in **any** of their fields are of an exact keyword match **OR** fuzzy keyword match with `bernice` **OR** `charlot`. In the sample data provided, the list will return persons `Bernice Yu` and `Charlotte Oliveiro`. Keyword `bernice` is an exact keyword match with one of the keywords `Bernice` and `charlot` is a fuzzy keyword match with one of the keywords `Charlotte` in `Charlotte Oliveiro`. | ||
|
||
[TIP] | ||
The search is case insensitive in HR+. e.g `bernice` might match `Bernice`. + | ||
|
@@ -332,7 +332,7 @@ Returns list of persons that matches the following conditions: + | |
1. Keywords in their `email` field are of an exact match **OR** fuzzy match with `[email protected]` **OR** `[email protected]` **AND** + | ||
2. Keywords in their `job applied` field are of an exact match **OR** fuzzy match with `Software` **AND** + | ||
3. Keywords in their `phone` field are of an exact match **OR** fuzzy match with `87438807`. + | ||
In the sample data provided, the list with return person `Alex` as he is the only person that matches all these conditions. | ||
In the sample data provided, the list will return person `Alex` as he is the only person that matches all these conditions. | ||
|
||
[TIP] | ||
The first keyword is prepended with a prefix, thus this command assumes a prefix search. A prefix search does an **OR** search between keywords in the same prefix and an **AND** search between different prefixes. + | ||
|
@@ -357,10 +357,10 @@ Keywords are not comma separated, thus they are treated as one keyword. | |
|
||
* `find bernice, "alex", ir*, *li` + | ||
Returns list of persons with **any** of their fields that matches the following conditions: + | ||
1. Keywords that are of an exact match **OR** fuzzy match with keyword `bernice` | ||
2. Field contains keyword `alex` | ||
3. Field starts with keyword `ir` | ||
4. Field ends with keyword `li` | ||
1. Keywords that are of an exact match **OR** fuzzy match with keyword `bernice` **OR** | ||
2. Field contains keyword `alex` **OR** | ||
3. Field starts with keyword `ir` **OR** | ||
4. Field ends with keyword `li` + | ||
In the sample data provided, this command will return persons `Alex Yeoh`, `Bernice Yu`, `David Li` and `Irfan Ibrahim`. + | ||
|
||
* `find n/bernice, "alex", ir*, *li e/*example.com p/"5" m/Computer*` + | ||
|
@@ -666,6 +666,7 @@ There is no need to save manually. | |
|
||
Displays the tags that are added to a student in the left panel. | ||
|
||
// tag::futurefind[] | ||
=== Highlights search results in user interface `[coming in v2.0]` | ||
|
||
Highlights search results after user executes the `find` command. | ||
|
@@ -682,11 +683,12 @@ Allows user to toggle which search support they want at any point of time. | |
|
||
Allows user to view a list of suggested searches on the fly when typing in their search keywords. | ||
|
||
=== Customising rating criteria `[coming in v2.0]` | ||
Specifies the criteria that candidates will be rated against. | ||
|
||
=== Saving searches `[coming in v2.0]` | ||
Saves searches that can be displayed in future for fast lookups. | ||
// end::futurefind[] | ||
|
||
=== Customising rating criteria `[coming in v2.0]` | ||
Specifies the criteria that candidates will be rated against. | ||
|
||
=== Sending and receiving emails `[coming in v2.0]` | ||
Sends and receives emails within HR+. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters