Skip to content

Commit

Permalink
Merge pull request #140 from IamRENCE/master
Browse files Browse the repository at this point in the history
Fix typo in DeverloperGuide and PPP
  • Loading branch information
DanKhoo authored Nov 12, 2018
2 parents 494eac1 + 83385b9 commit 9f74fec
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
46 changes: 24 additions & 22 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@ Figure 3.9.3.2 Idea of Second Implementation
==== Introduction
Similar to the rate command, we have implemented a feedback command feature as an enhancement, which also focuses on the
`Logic` component. A `Feedback` class is implemented to support this, which the `Person` class is dependent on. This
command allows users, especially for managers to give feedback to their employees within an organisation for them to
command allows users, especially for managers, to give feedback to their employees within an organisation for them to
know what to look out for in their performance and improve themselves.

[NOTE]
This command also differs from the add and edit command, because users cannot simply add an employee with a feedback
through the add command or edit an employee's feedback through the edit command. Every added employee will start off
through the add command or edit an employee's feedback through the edit command. Every employee added will start off
without any feedback assigned to him/her.

[CAUTION]
Expand All @@ -353,7 +353,7 @@ image::FeedbackSequenceDiagram.png[width="800"]
A simple profanity is implemented in the `Feedback` class, which checks for any profanity found within the feedback
input (Adapted from https://gist.github.com/PimDeWitte/c04cc17bc5fa9d7e3aee6670d4105941[Simple Profanity Filter]).
The list of English and Singlish profanities (https://github.com/CS2103-AY1819S1-T13-2/main/blob/master/src/main/resources/words%20to%20ban/Bad_Words_List.txt[Profanity List])
used can be subjected to expansion and modification. The fiter works by iterating through the whole input to find any possible
used can be subjected to expansion and modification. The filter works by iterating through the whole input to find any possible
sequence of words (no re-ordering) that match any profanity found within the profanity list. As such, runtime will be
dependent on input length rather than profanity list length.

Expand All @@ -375,10 +375,10 @@ image::FeedbackProfanitySequenceDiagram.png[width="800"]
`[THE_BAD_WORD]` can be used with, e.g. paki, pakistan. "paki" is a racial slur and will be rejected, but if "pakistan", a
country name, is entered, "pakistan" will be accepted even though it contains "paki".

** Each iteration ends when the end of the string is reached or the current substring check reaches the longest profanity
string length within the txt file (For increased performance).
** Each iteration ends when the end of the string is reached or the length of the current substring checked reaches the longest profanity
string length within the profanity list (For increased performance).

* Any leetspeak in the input will be replaced by the appropriate characters before the check, i.e. "H3ll0" will be
* Any leetspeak in the input will be replaced by its appropriate characters before the check, i.e. "H3ll0" will be
corrected to "Hello".

[CAUTION]
Expand All @@ -391,43 +391,43 @@ Given below is a sample run of the profanity filter with a feedback input of "u

* Iteration 1:

** 1a: "u": Not a profanity (No match with line in txt file).
** 1b: "u ": Not a profanity (No match with line in txt file).
** 1a: "u": Not a profanity (No match with line in profanity list).
** 1b: "u ": Not a profanity (No match with line in profanity list).
** ...
** 1g: "u suckz": Not a profanity (No match with line in txt file).
** 1g: "u suckz": Not a profanity (No match with line in profanity list).

* Iteration 2:

** 2a: " ": Not a profanity (No match with line in txt file).
** 2b: " s": Not a profanity (No match with line in txt file).
** 2a: " ": Not a profanity (No match with line in profanity list).
** 2b: " s": Not a profanity (No match with line in profanity list).
** ...
** 2f: " suckz": Not a profanity (No match with line in txt file).
** 2f: " suckz": Not a profanity (No match with line in profanity list).

* Iteration 3:

** 3a: "s": Not a profanity (No match with line in txt file).
** 3b: "su": Not a profanity (No match with line in txt file).
** 3c: "suc": Not a profanity (No match with line in txt file).
** 3d: "suck": *Profanity*! (Matches with a line in txt file). Added to a list of bad words found.
** 3e: "suckz": Not a profanity (No match with line in txt file).
** 3a: "s": Not a profanity (No match with line in profanity list).
** 3b: "su": Not a profanity (No match with line in profanity list).
** 3c: "suc": Not a profanity (No match with line in profanity list).
** 3d: "suck": *Profanity*! (Matches with a line in profanity list). Added to a list of bad words found.
** 3e: "suckz": Not a profanity (No match with line in profanity list).

* ...

* Iteration 7:

** 7a: "z": Not a profanity (No match with line in txt file).
** 7a: "z": Not a profanity (No match with line in profanity list).

* The resulting list has only 1 value: "suck" and input will be rejected since there is at least 1 profanity found.
* The resulting list has only 1 value: "suck" and the input will be rejected since there is at least 1 profanity found.

==== Design Considerations
===== How to implement the profanity filter
To ensure **fast retrieval**, a HashMap is used to store profanities to be rejected before using it to check if the
To ensure **fast retrieval**, a HashMap is used to store profanities to be rejected from the data file before using it to check if the
input contains any profanities inside.

* **Alternative 1 (current choice):** Check every substring of the input to see if it matches any profanity-to-reject
within the HashMap.
** Pros: **O(1)** runtime per substring when checking whether a particular substring of the input.
** Cons: Runs for **O(n²)** time, where n is the number of characters in the input.
** Cons: Runs for **O(n^2^)** time, where n is the number of characters in the input.
*** While this may look daunting, we have a character input limit on `Person` attributes (feedback included) of 50.
As such, there is an imposed upper bound on the performance time, preventing any significant decline in performance.
*** Also, one optimisation method implemented (mentioned in <<Feedback-Features, Feedback noteworthy features>>) is
Expand All @@ -441,6 +441,7 @@ characters in the input, and is capped at n ≤ 50 (Mentioned in Alternative 1).
extending the list of profanities-to-reject (i.e. Adding profanities of other languages, adding newly created profanities,
adding profanities that have been overlooked, etc.)
*** Hence, this alternative is not as efficient as **O(lm)** in Alternative 1 as l can be capped but m may not.

// end::feedbackcommand[]

// tag::ratecommand[]
Expand All @@ -466,13 +467,14 @@ There are 2 validation regular expressions found in the `Rating` class:

* `VALIDATION_REGEX` which checks for integer values from 0 - 10 of `Rating` which have already been added. 0 is included
as there may be a case when a `Person` has already been added but his/her `Rating` has yet to be updated.
* `VALIDATION_INPUT_REGEX` which checks for integer values from 1 - 10 of 'Rating' to be added by users with the rate
* `VALIDATION_INPUT_REGEX` which checks for integer values from 1 - 10 of `Rating` to be added by users with the rate
command.


Given below is a sequence diagram shows how the rate operation works:

image::RateSequenceDiagram.png[width="800"]

// end::ratecommand[]

// tag::privacycommand[]
Expand Down
28 changes: 14 additions & 14 deletions docs/team/iamrence.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ image::Ui.png[width="600"]
This project portfolio serves to document my contributions to SSENISUB, a CS2103 (Software Engineering)
project, as part of my Computer Science curriculum in National University of Singapore (NUS).

SSENISUB is an business management application which is used for managing employees' information within an organisation.
Its name is inspired from the the word "business", and is simply a palindrome of it. It is morphed from the given
SSENISUB is a business management application which is used for managing employees' information within an organisation.
Its name is inspired from the word "business", and is simply a palindrome of it. It is morphed from the given
`addressbook-level4` application as its base. The user interacts with it mainly using a
Command Line Interface (CLI). In conjunction with the CLI, a Graphical User Interface (GUI) is used to make it more
user-friendly, supported by coloured text and symbols. This application is written in Java with about 15 kLoC,
Expand All @@ -36,8 +36,8 @@ face of the application.
his/her employees' performance, which is especially important during the *year-end performance review*. It potentially
affects how much bonus or credit is given to the staff in the organisation.
** Highlights: This enhancement looks similar to the add and edit command, but has to be made to *execute asynchronous* to
these commands. In future releases, where users of different level of authorisations are allowed to use different commands,
this command would only be accessible to managers (or direct superiors). The reason is because they have the right to and are in
these commands. In future releases, where users of different levels of authorisation are allowed to use different commands,
this command would only be accessible to managers (or direct superiors). The reason is that they have the right to and are in
the best position to give any rating to their staff.

* *Major enhancement 2*: added *the ability to give feedback to staff* stored inside the application
Expand Down Expand Up @@ -76,25 +76,25 @@ to base the runtime on input length or the number of profanities to be rejected.
* *Other contributions*:

** Project management:
*** Checked `v1.1` - `v1.4` (4 releases) before team member released them on GitHub
*** Checked `v1.1` - `v1.4` (4 releases) before they got released them on GitHub.
** Enhancements to existing features:
*** Updated the application icon
(Pull request https://github.com/CS2103-AY1819S1-T13-2/main/pull/42[#42])
(Pull request https://github.com/CS2103-AY1819S1-T13-2/main/pull/42[#42]).
*** Wrote additional tests for existing features to increase coverage from 93.4% to 93.6%
(Pull request https://github.com/CS2103-AY1819S1-T13-2/main/pull/58[#58])
(Pull request https://github.com/CS2103-AY1819S1-T13-2/main/pull/58[#58]).
** Bug fixes:
*** Fixed bugs in the rate and feedback command that allowed for inputs that should have been rejected
(Pull request https://github.com/CS2103-AY1819S1-T13-2/main/pull/58[#58])
*** Fixed bugs commands that allowed for inputs that otherwise should have been rejected
(Pull request https://github.com/CS2103-AY1819S1-T13-2/main/pull/58[#58]).
*** Fixed overall UI/code bug where "Address Book"/"AddresBook" is displayed or used instead of our application "SSENISUB"
(Pull request https://github.com/CS2103-AY1819S1-T13-2/main/pull/107[#107])
(Pull request https://github.com/CS2103-AY1819S1-T13-2/main/pull/107[#107]).
** Documentation:
*** Updated existing contents of the User Guide:
https://github.com/CS2103-AY1819S1-T13-2/main/pull/101[#101],
https://github.com/CS2103-AY1819S1-T13-2/main/pull/102[#102],
https://github.com/CS2103-AY1819S1-T13-2/main/pull/109[#109]
https://github.com/CS2103-AY1819S1-T13-2/main/pull/109[#109].
*** Updated existing contents of the Developer Guide:
https://github.com/CS2103-AY1819S1-T13-2/main/pull/29[#29],
https://github.com/CS2103-AY1819S1-T13-2/main/pull/109[#109]
https://github.com/CS2103-AY1819S1-T13-2/main/pull/109[#109].
** Community:
*** PRs reviewed:
https://github.com/CS2103-AY1819S1-T13-2/main/pull/12[#12],
Expand All @@ -109,11 +109,11 @@ https://github.com/CS2103-AY1819S1-T13-2/main/pull/100[#100],
https://github.com/CS2103-AY1819S1-T13-2/main/pull/103[#103],
https://github.com/CS2103-AY1819S1-T13-2/main/pull/104[#104],
https://github.com/CS2103-AY1819S1-T13-2/main/pull/106[#106],
https://github.com/CS2103-AY1819S1-T13-2/main/pull/108[#108]
https://github.com/CS2103-AY1819S1-T13-2/main/pull/108[#108].
*** Reported bugs and suggestions for other teams in the class
(examples: https://github.com/CS2103-AY1819S1-F11-3/main/issues/184[1],
https://github.com/CS2103-AY1819S1-F11-3/main/issues/198[2],
https://github.com/CS2103-AY1819S1-F11-3/main/issues/200[3])
https://github.com/CS2103-AY1819S1-F11-3/main/issues/200[3]).

== Contributions to the User Guide

Expand Down

0 comments on commit 9f74fec

Please sign in to comment.