Skip to content

Commit

Permalink
ASCII Table & User Guide Update & PPP Update
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffinsonDarmawan committed Apr 14, 2024
1 parent e266939 commit d204876
Show file tree
Hide file tree
Showing 10 changed files with 397 additions and 219 deletions.
222 changes: 138 additions & 84 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,44 @@ Format: `help`
Expected output:

```
Here are the list of commands you can use:
1. new <bouquetName> - Add a bouquet
2. delete <bouquetName> - Delete a bouquets
3. mybouquets - List current saved bouquets
4. info <flowerName> - Provide information on chosen flower
5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet
6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet
7. flowers - Shows a list of flowers that can be added into mybouquets
8. flowers <occasion> - Shows a list of flowers associated with said occasion
9. occasion - Shows a list of occasions associated with available flowers
10. save <bouquetName> - Saves a bouquet to an external <bouquetName>.txt file
11. recommend - Recommends a bouquet based on the chosen occasion and colour
12. bye - Exits the programme
Here is the table showing a list of commands you can use:
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| No. | Command | Explanation | Example |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 1 | new <bouquetName> | Add a bouquet | new Birthday Bouquet |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 2 | delete <bouquetName> | Delete a bouquets | delete Birthday Bouquet |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 3 | mybouquets | List current saved bouquets | mybouquets |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 4 | info <flowerName> | Provide information on chosen flower | info Rose |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 5 | add <flowerName> /c <colour> (optional) /q <quantity> | Add flower to a bouquet | add Rose /c Red /q 5 /to Birthday Bouquet |
| | /to <bouquetName> | | |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 6 | remove <flowerName> /c <colour> (optional) /q <quantity> | Remove flower from a bouquet | remove Rose /c Red /q 5 /from Birthday Bouquet |
| | /from <bouquetName> | | |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 7 | flowers | Shows a list of flowers that can be | flowers |
| | | added into mybouquets | |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 8 | flowers <occasion> | Shows a list of flowers associated | flowers Valentines |
| | | with said occasion | |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 9 | occasion | Shows a list of occasions associated | occasion |
| | | with available flowers | |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 10 | save <bouquetName> | Saves a bouquet to an external | save Birthday Bouquet |
| | | <bouquetName>.txt file | |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 11 | recommend | Recommends a bouquet based on the | recommend |
| | | chosen occasion and colour | |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 12 | compare <1st flowerName> /vs/ <2nd flowerName> | Show information regarding two flowers | compare Rose /vs/ Lily |
| | | side-by-side for comparison | |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
| 13 | bye | Exits the programme | bye |
+-----+----------------------------------------------------------+----------------------------------------+------------------------------------------------+
```

### Create a new bouquet: `new`
Expand Down Expand Up @@ -118,12 +143,14 @@ Example: `info Lily`

Expected Output:
```
Here is page 1/1 of info regarding flowers whose name contains Lily:
1. Name: Lily
Colour: White
Occasions: Funeral, Wedding
Price: $2.50
Meanings: Innocence
Here is a table of information about the flower Lily:
+-----+-------------+--------+--------------------+-------------+--------+-----------+
| No. | Flower Name | Colour | Occasion | Meaning | Type | Price ($) |
+-----+-------------+--------+--------------------+-------------+--------+-----------+
| 1 | Lily | White | [FUNERAL, WEDDING] | [Innocence] | FLOWER | 2.50 |
+-----+-------------+--------+--------------------+-------------+--------+-----------+
| 2 | Lily | Orange | [] | [Hatred] | FLOWER | 2.50 |
+-----+-------------+--------+--------------------+-------------+--------+-----------+
____________________________________________________________
```

Expand Down Expand Up @@ -199,46 +226,46 @@ Recommends a bouquet based on the occasion and the recipient's preference
Steps:
1. Type command: `recommend`

Expected output:
```
For what occasion are you buying flowers for?
Here is the list of our available occasion:
Here are all the occasions associated with the available flowers:
- Funeral
- Wedding
- Valentines
- Mothers day
____________________________________________________________
```
Expected output:
```
For what occasion are you buying flowers for?
Here is the list of our available occasion:
Here are all the occasions associated with the available flowers:
- Funeral
- Wedding
- Valentines
- Mothers day
____________________________________________________________
```
2. Type occasion: `Funeral`

Expected output:
```
What colour would you like your bouquets to be?
Here is the list of colours available for the occasion:
- DARK_CRIMSON
- WHITE
```
Expected output:
```
What colour would you like your bouquets to be?
Here is the list of colours available for the occasion:
- DARK_CRIMSON
- WHITE
```

3. Select colour of bouquet: `WHITE`

Expected output:

```
Would you like to save this bouquet to your list?
Here is the full list of flowers in Recommended Bouquet:
- 3 x Lily
- 2 x Chrysanthemum
____________________________________________________________
Type 'yes' to save, 'no' to discard
```
Expected output:
```
Would you like to save this bouquet to your list?
Here is the full list of flowers in Recommended Bouquet:
- 3 x Lily
- 2 x Chrysanthemum
____________________________________________________________
Type 'yes' to save, 'no' to discard
```
4. Confirm whether you want to add the recommended bouquet to your mybouquets list: `yes`

```
Added new bouquet to list:
Recommended Bouquet
____________________________________________________________
```
```
Added new bouquet to list:
Recommended Bouquet
____________________________________________________________
```

### Save a bouquet to device: `save`
Saves chosen bouquet, if it exists, locally to the users device
Expand All @@ -255,6 +282,34 @@ Expected Output:
Successfully saved moms bouquet. You can find it at 'florizz-out/saved/moms bouquet.txt'
```

### Compare two flowers: `compare`
Compares the colour, occasion, meaning, type and price of flowers based on flower names

Format: `compare <flowerName1> /vs/ <flowerName2>`

- Both flowers must exist in the database

Examples:
- `compare Rose /vs/ Lily`

Expected output:
```
Here is a table of comparison between the two flowers:
+-----+-------------+--------------+------------------------------------+------------------------------------------+--------+-----------+
| No. | Flower Name | Colour | Occasion | Meaning | Type | Price ($) |
+-----+-------------+--------------+------------------------------------+------------------------------------------+--------+-----------+
| 1 | Rose | Dark crimson | [FUNERAL] | [Mourning] | FLOWER | 2.00 |
+-----+-------------+--------------+------------------------------------+------------------------------------------+--------+-----------+
| 2 | Rose | Red | [VALENTINES, WEDDING, MOTHERS_DAY] | [Love] | FLOWER | 2.00 |
+-----+-------------+--------------+------------------------------------+------------------------------------------+--------+-----------+
| 3 | Rose | Yellow | [] | [Jealousy, Decrease of love, Infidelity] | FLOWER | 2.00 |
+-----+-------------+--------------+------------------------------------+------------------------------------------+--------+-----------+
| 4 | Lily | White | [FUNERAL, WEDDING] | [Innocence] | FLOWER | 2.50 |
+-----+-------------+--------------+------------------------------------+------------------------------------------+--------+-----------+
| 5 | Lily | Orange | [] | [Hatred] | FLOWER | 2.50 |
+-----+-------------+--------------+------------------------------------+------------------------------------------+--------+-----------+
```

### Exit programme: `bye`

Exits the program.
Expand All @@ -268,50 +323,49 @@ Enjoy your bouquet! Thank you for using Florizz!

### Fuzzy Logic

Florizz uses a type of fuzzy logic to rectifies typos in user input by utilising the Damerau-Levenshtein Distance
to measure the similarity between the user input and a valid command/item/occasion.
Florizz uses a type of fuzzy logic that rectifies typos in user input by utilising the Damerau-Levenshtein Distance
to measure the similarity between the user input and a valid command/flower/colour/occasion.

The Damerau-Levenshtein distance measures the minimum number of single-character edits required to change one string
into another. These edits can be insertions, deletions, substitutions and transpositions of individual characters.

When a typo is detected, Florizz will make a calculated guess as to the valid commands that a user is actually calling.
When a typo is detected, Florizz will make a calculated guess as to the valid command that a user is actually referring to.

Examples:
- `newq mybouquet1`
- `adds Chysanthenum /q 10 /to mybouquet1`
- `delate mybouquet1`
Examples of typos that Florizz can rectify include:

1. Typo in spelling
- `flowerz Vlentine`
- `ads Ross /c ret /q 10 /to mybouquet1`
2. Incorrect placements of whitespaces
- `c o m p are R ose /v s/ L i ly`
- `m y b ouq ue ts`
3. Absence of whitespaces
- `flowersmothersday`
- `infoDaisy`

Expected output:

```
newq mybouquet1
--> Your input is [newq] but I am guessing you mean [new]
Added new bouquet to list:
mybouquet1
____________________________________________________________
What can I do for you?
flowerz Vlentine
--> Your input is [flowerz] but I am guessing you mean [flowers]
--> Your input is [Vlentine] but I am guessing you mean [Valentines]
```

```
adds Chysanthenum /q 10 /to mybouquet1
--> Your input is [adds] but I am guessing you mean [add]
--> Your input is [Chysanthenum] but I am guessing you mean [Chrysanthemum]
You have successfully added the following:
- 10 x chrysanthemum -> Bouquet: mybouquet1
Here is the list of your saved bouquets:
1. mybouquet1 :
- 10 x Chrysanthemum
Total estimated price = $10.00
____________________________________________________________
What can I do for you?
ads Ross /c ret /q 10 /to mybouquet1
--> Your input is [ads] but I am guessing you mean [add]
--> Your input is [Ross] but I am guessing you mean [Rose]
--> Your input is [ret] but I am guessing you mean [Red]
```

```
delate mybouquet1
--> Your input is [delate] but I am guessing you mean [delete]
Deleted bouquet:
mybouquet1
____________________________________________________________
What can I do for you?
c o m p are R ose /v s/ L i ly
--> Your input is [c o m p are R ose /v s/ L i ly] but I am guessing you mean [compare Rose /vs/ Lily]
```

```
flowersmothersday
--> Your input is [flowersmothersday] but I am guessing you mean [flowers Mothers Day]
```

### Autosave
Expand Down
42 changes: 32 additions & 10 deletions docs/team/jeffinsondarmawan.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ Code Contribution: [Jeffinson Darmawan RepoSense Report](https://nus-cs2113-ay23
`info Rose` where Florizz will show information regarding that flower. Suppose that a user mistakenly input
`invo Ross` and another user mistakenly input `zjgh bfre`. Without Fuzzy Logic, both `invo Ross` and `zjgh bfre`
will be regarded as equaly invalid commands and the programme will throw an exception. However, one can make a
strong case that `invo Ross` is definitely closer to `info Rose` compared to `zjgh bfre`. Thus, Fuzzy Logic helps
users by correcting their typos due to accidental human errors and increase the overall convenience of using the
programme. Imagine having to retype `adds Rose /q 1 /to Bouquet for My 3th Anniversary with My Girlfriend` because
of a small mistake of having an "s" after "add" and repeating this over and over again!


strong case that `invo Ross` is definitely closer to `info Rose` compared to `zjgh bfre`.
- Justification:
Fuzzy Logic helps
users by correcting their typos due to accidental human errors and increase the overall convenience of using the
programme. This feature is especially useful for users who are prone to making typos in their inputs. By implementing
Fuzzy Logic, Florizz is able to correct these typos and provide the user with the intended output thereby reducing
the effect of human errors.Imagine having to retype `adds Rose /q 1 /to Bouquet for My 3th Anniversary with My Girlfriend`
because of a small mistake of having an "s" after "add" and repeating this over and over again!
- How it works:

Fuzzy Logic in Florizz works primarily in 3 ways. Firstly, applying
Expand All @@ -46,13 +48,29 @@ Code Contribution: [Jeffinson Darmawan RepoSense Report](https://nus-cs2113-ay23

2. Listing Available Occasion (Pull Request [#26](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/26))
- What it is:
`Occasion` lists out all the occasions which are associated will all flowers in our database. This
`occasion` lists out all the occasions which are associated will all flowers in our database. This
allows users to have a quick look at what occasions they can choose for their flowers. Once users know what occasion
they can input `flowers <occasion>` to see all the flowers associated with the occasion of choosing.

- Justification:
This feature is especially useful for users who are unsure of what flowers to choose for a specific occasion.
3. Help Command (Pull Request [#16](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/16))
- What it is:
`help` assists users in using Florizz by showing a quick list of commands that users can use.
- Justification:
This feature is especially useful for new users who are unfamiliar with the commands available in Florizz.
- Highlights:
This feature uses an ASCII table to increase readability of the list of available commands.
4. Compare Command
- What it is:
`compare` allows users to compare the colour, occasion, meaning, type and price of two flowers.
- Justification:
When deciding which flowers to add to a bouquet, users might find it difficult to compare between different flowers
as they need to separately call the `info` command for each flower.
Thus, this feature is especially useful for users who are deciding between two flowers and want to know the
differences between them.
- Highlights:
This feature required the implementation of a new command and the creation of a new class to handle the comparison of two flowers.
It also uses an ASCII table to increase readability of the comparison results.

**Enhancements:**
1. Applying appropriate exceptions to ensure valid integer inputs in all commands involving integers
Expand All @@ -70,5 +88,9 @@ Code Contribution: [Jeffinson Darmawan RepoSense Report](https://nus-cs2113-ay23
- Added UML diagrams and implementation details for `remove` and `help`
2. User Guide
(Pull Request [#106](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/106))
- Added documentation on Fuzzy Logic
- Updated documentation on `help`, `new`, `add` and `remove`
- Added documentation on `compare` and Fuzzy Logic
- Updated documentation on `help`, `new`, `add` and `remove`

**Tools**
1. Integrated a third party JTextUtil library called "freva ascii-table" to create ASCII tables for the `help`
and `compare` commands. (Link to Github Page: [Freva ASCII Table](https://github.com/freva/ascii-table))
Loading

0 comments on commit d204876

Please sign in to comment.