From 7a73fe7785fec569de9a79e3d4934997f9d02f43 Mon Sep 17 00:00:00 2001 From: Jeffinson Darmawan Date: Wed, 3 Apr 2024 21:53:06 +0800 Subject: [PATCH 1/2] no message --- FlorizzLogger.xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FlorizzLogger.xml diff --git a/FlorizzLogger.xml b/FlorizzLogger.xml deleted file mode 100644 index e69de29bb2..0000000000 From c1c02eaf6b5003bceeb9d3cf8c011f2283d350eb Mon Sep 17 00:00:00 2001 From: Jeffinson Darmawan Date: Wed, 3 Apr 2024 23:39:23 +0800 Subject: [PATCH 2/2] User Guide --- docs/UserGuide.md | 73 ++++++++++++++++++++++++++---- src/main/java/florizz/core/Ui.java | 3 +- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 317d369111..44879d57d1 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -21,7 +21,8 @@ Here are the list of commands you can use: 8. flowers - Shows a list of flowers associated with said occasion 9. occasion - Shows a list of occasions associated with available flowers. 10. save - Saves a bouquet to an external .txt file -11. bye - Exits the programme +11. recommend - Recommends a bouquet based on the chosen occasion and colour +12. bye - Exits the programme ``` ### Create a new bouquet: `new` @@ -83,7 +84,7 @@ Chrysanthemum ``` ### View detailed info of a flower: info -Get detailed info (colour, meaning etc) about a specific flower in the database +Get detailed info (colour, meaning, etc.) about a specific flower in the database Format: `info ` @@ -107,16 +108,19 @@ Format: `add /q /to ` - Bouquet must exist in the database Examples: -- `add Rose /q 3 /to Bouquet for mom` +- `add Rose /q 3 /to For Girlfriend` - `add Babys breath /q 2 /to Sister’s graduation` Expected Output: ``` You have successfully added the following: - - 3 x Rose -> Bouquet: For Girlfriend -Here are the list of your saved bouquets: + - 3 x rose -> Bouquet: For Girlfriend +Here is the list of your saved bouquets: 1. For Girlfriend : - 3 x Rose + Total estimated price = $6.00 +____________________________________________________________ +What can I do for you? ``` ### Remove flower: remove @@ -135,11 +139,14 @@ Examples: Expected output: ``` -You have successfully added the following: - - 1 x Rose -> Bouquet: For Girlfriend -Here are the list of your saved bouquets: +You have successfully removed the following: + - 1 x rose -> Bouquet: For Girlfriend +Here is the list of your saved bouquets: 1. For Girlfriend : - 2 x Rose + Total estimated price = $4.00 +____________________________________________________________ +What can I do for you? ``` ### List occasions: occasion @@ -200,7 +207,7 @@ Type 'yes' to save, 'no' to discard Added new bouquet to list: Recommended Bouquet ____________________________________________________________ - +``` ### Save a bouquet to device: save Saves chosen bouquet, if it exists, locally to the users device @@ -227,3 +234,51 @@ Expected output: 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. + +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. + +Examples: +- `newq mybouquet1` +- `adds Chysanthenum /q 10 /to mybouquet1` +- `delate mybouquet1` + +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? +``` +``` +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? +``` + +``` +delate mybouquet1 +--> Your input is [delate] but I am guessing you mean [delete] +Deleted bouquet: +mybouquet1 +____________________________________________________________ +What can I do for you? +``` + diff --git a/src/main/java/florizz/core/Ui.java b/src/main/java/florizz/core/Ui.java index 7c45b8389a..e77833a0a6 100644 --- a/src/main/java/florizz/core/Ui.java +++ b/src/main/java/florizz/core/Ui.java @@ -130,7 +130,8 @@ public void printHelpMessage() { System.out.println("8. flowers - Shows a list of flowers associated with said occasion"); System.out.println("9. occasion - Shows a list of occasions associated with available flowers."); System.out.println("10. save - Saves a bouquet to an external .txt file"); - System.out.println("11. bye - Exits the programme"); + System.out.println("11. recommend - Recommends a bouquet based on the chosen occasion and colour."); + System.out.println("12. bye - Exits the programme"); printBreakLine(); }