From d3ce3e570c9f3d81ce58e7e10ea1ae2ed32687c9 Mon Sep 17 00:00:00 2001 From: Jeffinson Darmawan Date: Thu, 11 Apr 2024 17:48:02 +0800 Subject: [PATCH 1/4] PPP --- docs/team/JeffinsonDarmawan.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/team/JeffinsonDarmawan.md b/docs/team/JeffinsonDarmawan.md index a6424ff4f6..e432d6ec5f 100644 --- a/docs/team/JeffinsonDarmawan.md +++ b/docs/team/JeffinsonDarmawan.md @@ -1,13 +1,9 @@ -# Design & Implementation +# Jeffinson Darmawan - Project Portfolio Page -## Flower Removal Command +## Overview +Florizz is a digital florist replacement that helps users choose appropriate +flowers to put into a bouquet for various occasions. -**Step 1:** Removing flowers utilise the `parser` class to parse user command to identify which flower to remove, -how much to remove and from which bouquet to remove. - -**Step 2:** User will input `remove /q /from ` and once `parser` identifies the -appropriate keywords, it will instantiate the `HelpCommand` class and run its `execute()` method. - -**Step 3:** `HelpCommand` class will call `printHelpMessage()` method of `Ui` class - -**Step 4:** The list of valid commands will be printed by the `Ui` class +### Summary of Contributions +* Code Contribution: [RepoSense Report](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=jeffinsondarmawan&breakdown=true) +* \ No newline at end of file From bc56fb21025807b932d00f53227f63fa2cf7e9c5 Mon Sep 17 00:00:00 2001 From: Jeffinson Darmawan Date: Thu, 11 Apr 2024 23:18:23 +0800 Subject: [PATCH 2/4] More PPP --- docs/team/JeffinsonDarmawan.md | 65 +++++++++++++++++++++++++++++- src/main/java/florizz/core/Ui.java | 1 + 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/docs/team/JeffinsonDarmawan.md b/docs/team/JeffinsonDarmawan.md index e432d6ec5f..f0675e125d 100644 --- a/docs/team/JeffinsonDarmawan.md +++ b/docs/team/JeffinsonDarmawan.md @@ -5,5 +5,66 @@ Florizz is a digital florist replacement that helps users choose appropriate flowers to put into a bouquet for various occasions. ### Summary of Contributions -* Code Contribution: [RepoSense Report](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=jeffinsondarmawan&breakdown=true) -* \ No newline at end of file +Code Contribution: [Jeffinson Darmawan RepoSense Report](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=jeffinsondarmawan&breakdown=true) + +**New Features:** + +1. Fuzzy Logic (Pull Request [#71](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/71), +[#83](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/83), +[#84](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/84), +[#87](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/87), +[#162](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/162)) + + - What it is: + + Theoretically, Fuzzy Logic is a mathematical framework that deals with uncertainty and imprecision in + decision-making. Rather than only accepting a binary value of truth (i.e. true or false), Fuzzy Logic allows variables + to have a degree of truth which gives it the sense of "Fuzziness". Practically, Fuzzy Logic is implemented in + the Florizz programme to reduce human error in typing inputs with typos. For example, take a valid command of + `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"! + + - How it works: + + Fuzzy Logic in Florizz works primarily in 3 ways. Firstly, applying + `detectItem(userInput, validCommand)`, Florizz will calculate the Damerau-Levenshtein distance which is a metric + used to measure the similarity between the user input and a list of predetermined valid commands. + It calculates the minimum number of single-character edits required to change userInput to a valid command, + by counting the number of insertions, deletions, substitutions and transpositions of individual characters. For + Florizz, we use a SIMILARITY_THRESHOLD of 2, meaning that we would only match a userInput to a valid command which + has the smallest distance that is less than 2. example, the userInput: `myboquets` compared to a validCommand: + `mybouquets` has a Damerau-Levenshtein distance of one. Secondly, Florizz also recognises inputs which mistakenly + have whitespaces separating alphabets which form valid commands. For example, Florriz is able to correct `h e l p` + into `help` or `re mov e Lily /q 1 /from bouquet`into `remove Lily /q 1 /from bouquet`. Thirdly, Florizz can + also correct inputs which are mistakenly glued to each other, such as `flowersmothersday` into `flowers Mothers Day`. + +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 + 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 ` to see all the flowers associated with the occasion of choosing. + +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. + +**Enhancements:** +1. Applying appropriate exceptions to ensure valid integer inputs in all commands involving integers +(Pull Request [#166](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/166)) +2. Added price information to bouquets (Pull Request [#65](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/65)) +3. Improving Parser class by applying FuzzyLogic.detectItem() +(Pull Request [#71](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/71)) + +**Documentation** +1. Developer Guide +(Pull Request [#82](https://github.com/AY2324S2-CS2113-T11-3/tp/pull/82)) + - 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` \ No newline at end of file diff --git a/src/main/java/florizz/core/Ui.java b/src/main/java/florizz/core/Ui.java index 115cc740c1..612aa64e65 100644 --- a/src/main/java/florizz/core/Ui.java +++ b/src/main/java/florizz/core/Ui.java @@ -27,6 +27,7 @@ public void printIntroMessage(){ " |_| |_|\\___/|_| |_/___/___|\n" + "\n"; System.out.println("Hello from\n" + logo); + System.out.println("Type `help`, to view a list of valid commands!"); } /** From 75b11d76f540adda47f0bc6809e43db4bec885c0 Mon Sep 17 00:00:00 2001 From: Jeffinson Darmawan Date: Thu, 11 Apr 2024 23:24:47 +0800 Subject: [PATCH 3/4] Type `help`, to view a list of valid commands! --- text-ui-test/EXPECTED-UNIX.TXT | 2 +- text-ui-test/EXPECTED.TXT | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/text-ui-test/EXPECTED-UNIX.TXT b/text-ui-test/EXPECTED-UNIX.TXT index 7dad8f5db0..2434938eb4 100644 --- a/text-ui-test/EXPECTED-UNIX.TXT +++ b/text-ui-test/EXPECTED-UNIX.TXT @@ -7,7 +7,7 @@ Hello from | | | | (_) | | | |/ / / / |_| |_|\___/|_| |_/___/___| - +Type `help`, to view a list of valid commands! What can I do for you? Here are the list of commands you can use: 1. new - Add a bouquet diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index 7dad8f5db0..2434938eb4 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -7,7 +7,7 @@ Hello from | | | | (_) | | | |/ / / / |_| |_|\___/|_| |_/___/___| - +Type `help`, to view a list of valid commands! What can I do for you? Here are the list of commands you can use: 1. new - Add a bouquet From b0aff654ed416bbc42c601bdc5d7a7f425f23af8 Mon Sep 17 00:00:00 2001 From: Jeffinson Darmawan Date: Thu, 11 Apr 2024 23:27:17 +0800 Subject: [PATCH 4/4] io redirection --- text-ui-test/EXPECTED-UNIX.TXT | 1 + text-ui-test/EXPECTED.TXT | 1 + 2 files changed, 2 insertions(+) diff --git a/text-ui-test/EXPECTED-UNIX.TXT b/text-ui-test/EXPECTED-UNIX.TXT index 2434938eb4..91154c460d 100644 --- a/text-ui-test/EXPECTED-UNIX.TXT +++ b/text-ui-test/EXPECTED-UNIX.TXT @@ -7,6 +7,7 @@ Hello from | | | | (_) | | | |/ / / / |_| |_|\___/|_| |_/___/___| + Type `help`, to view a list of valid commands! What can I do for you? Here are the list of commands you can use: diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index 2434938eb4..91154c460d 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -7,6 +7,7 @@ Hello from | | | | (_) | | | |/ / / / |_| |_|\___/|_| |_/___/___| + Type `help`, to view a list of valid commands! What can I do for you? Here are the list of commands you can use: