Overview
ɯeme is a meme manager app for those who prefer to use a desktop app for managing memes. More importantly, ɯeme is optimized for those who prefer to work with a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI). Users can view, tag, search, import and export a collection of meme. They can also create their own memes from meme templates.
Summary of contributions
-
Major enhancement: added the ability to suggest and auto-complete commands
-
What it does: allows the user to type command faster and more easily by showing possible command arguments and allow the user to use TAB key to auto-complete the command.
-
Justification: This feature improves the product significantly because a user can be tired of typing the full command over and over again, or unsure of what arguments to supply. This feature allows the user to see what are the available commands and in case the user forgets the exact spelling of the command, the user can then be reminded of the similar commands and use tab to automatically correct the typo. Furthermore, the user can be reminded of the possible commands arguments (e.g. popular tags) from past records when the user is short of ideas. The usage of tab for auto-completion also tremendously improves the speed of typing and hence the overall experience of the user.
-
Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it requires live update of input and different methods to process different commands in order to generate suggestions. The prompters mirrors parsers but they function differently. A branch new set of logic is implemented in the prompters and util methods to facilitate smoother suggestions and auto-completion.
-
Credits:
LevenshteinDistance
inorg.apache.commons.text
is used in calculating the similarity between strings.
-
-
Minor enhancement:
-
Refactored
commands
andparser
packages by grouping files into sub-packages according to the type of commands. [#114]
-
-
Code contributed: [RepoSense Data]
-
Other contributions:
Contributions to the User Guide
Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users. |
Command Suggestions
Weme supports command suggestions and auto-completion using tab for every command available.
Examples:
-
When user types in
a
in the meme tab, the following suggestions will appear:
add: adds a meme to Weme.
archive: archive a meme by index.
archives: list all archived memes.
After pressing Tab, a
in the command box will be replaced by add
.
-
When user types in
add p/pathToMeme t/c
in the memes tab, the following suggestions will appear:
CS
cute
csgg
After pressing Tab, c
in the command box will be replaced by CS
.
-
When user types in
find doge joker funny cuuuuutie
in the memes tab, the following suggestions will appear:
cute
CUTECATS
favorite
After pressing Tab, cuuuuutie
in the command box will be replaced by cute
.
Contributions to the Developer Guide
Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project. |
Command Suggestion Feature
Users can be forgetful about the command format and sometimes unsure of what arguments to supply. Auto-suggestion of command arguments while the user keys in inputs can be very helpful to provide user hints. Possible command words will be suggested to user based on incomplete input. Depending on what the user has typed in for the argument, the most similar argument values retrieved from the historical records will be displayed to the user for reference. The user can also use the "TAB" key to auto complete the command word/argument, where the first prompt will replace the current command word/argument in user input.
Current Implementation
The command suggestion is achieved using a package of prompter files.
For each parser, there will a corresponding prompter to process the current user input and return the CommandPrompt
for display in ResultBox
.
The following class diagram summarizes the Prompter package in the Logic.
The following Sequence Diagram summarizes the how a CommandPrompt
is generated:
Here is how a user interact with the command suggestion features:
Step 1. The user types commands into the CommandBox
.
Step 2. The MainWindow
listens to changes in the content in CommandBox
and direct the input to WemePrompter
.
Step 3. Depending on the context, the prompter that implements WemePrompter
(e.g. MemePrompter
) will then pass the arguments
to different Prompter
(e.g. MemeAddCommandPrompter
) based on the command word.
Step 4. The Prompter
will process the input and return a CommandPrompt
containing the command suggestion, and the
complete text for auto-completion for the given input.
Step 5. The prompt will be passed to and displayed by ResultBox
.
Step 6. The CommandBox
listens to the "TAB" key press, and replace the current argument with the first command prompt.
The following Activity Diagram summarizes the command suggestion process:
Design Considerations
Aspect: How to process the input and produce the command prompt
-
Alternative 1 (current choice): Use a prompter package to abstract out the prompter for each command.
-
Pros: Single Responsibility Principle and Separation of Concerns are achieved and coupling is reduced.
-
Cons: Additional layer of abstraction and longer code.
-
-
Alternative 2: Add one more method in each parser.
-
Pros: Easier to implement.
-
Cons: The class that processses input will depend on
Parser
.
-
Aspect: How to store and access historical records.
-
Alternative 1 (current choice): Use a separate
Records
storage file to store all the historical arguments.-
Pros: Better abstraction and the records has the option to persist even if the file is deleted.
-
Cons: More files to store and longer code.
-
-
Alternative 2: Store arguments of a resource (e.g.
Meme
) as a field of the resource.-
Pros: Easier to implement and cleaner.
-
Cons: Irrelevant information needs to be stored as a field (e.g. original file path of a resource).
-
Suggest / Auto-complete commands
-
Suggest and auto-complete command words
-
Prerequisites: Weme is in any tab, for illustration purpose we choose meme tab. Since this is for command suggestions, please do not press enter to execute the command while typing the input.
-
Test case:
a
Expected:
add: adds a meme to Weme.
archive: archive a meme by index.
archives: list all archived memes. -
Test case:
a
+ tab
Expected text inside command box:add
Expected text inside result box:
add: adds a meme to Weme. Parameters: p/PATH [d/DESCRIPTION] [t/TAG]…
Example: add p/C:\Users\username\Downloads\funny_meme.jpg d/Popular Meme among SoC Students t/funny -
Test case:
arkive
Expected:
archive: archive a meme by index.
archives: list all archived memes.
like: like a meme by index. -
Test case:
arkive
+ tab
Expected text inside command box:archive
Expected text inside result box:
archive: archive a meme by index. Parameters: INDEX (must be a positive integer) Example: archive 1
-
Test case:
undo
Expected:
undo: undo the previous command.
-
Test case:
unlike 1
Expected:
Unknown command
(The text in the command box will turn red to indicate invalid input)
-
-
Suggest command arguments
-
Prerequisites: Restore the application to initial state by deleting the data folder if it exists. The suggestions may change when new data is added since the recommendation is based on past records. Weme is in any tab, for illustration purpose we choose meme tab. Since this is for command suggestions, please do not press enter to execute the command while typing the input.
-
Test case:
add p/path/to/meme d/
Expected:
A meme about a test.
A meme about Char and charmander.
A meme about doge. -
Test case:
add p/path/to/meme d/
+ tab
Expected text inside command box:add p/path/to/meme d/A meme about a test.
Expected text inside command box:
A meme about a test.
A meme about doge.
A meme about joker. -
Test case:
edit 1 t/cuuute
Expected:
cute
CUTECATS
test -
Test case:
edit 1 t/cuuute
+ tab
Expected text inside command box:edit 1 t/cute
Expected text inside result box:
cute
CUTECATS
cuteAnimals -
Test case
find c
Expected:
CS
cute
CS2103 -
Test case
find c
+ tab
Expected text inside command box:find CS
Expected text inside result box:
CS
CS2103
CSLectures -
Test case
find cute dog
Expected:
doge
GoT
wow -
Test case
find cute dog
+ tab
Expected text inside command box:find cute doge
Expected text inside result box:
doge
cute
GoT -
Test case
add g/
Expected:
Invalid command format!
add: adds a meme to Weme. Parameters: p/PATH [d/DESCRIPTION] [t/TAG]…
Example: add p/C:\Users\username\Downloads\funny_meme.jpg d/Popular Meme among SoC Students t/funny
(The text in the command box will turn red to indicate invalid input) -
Test case
edit t/
Expected:
Invalid command format!
edit: edits the details of the meme identified by the index number used in the displayed meme list. Existing values will be overwritten by the input values.
Parameters: INDEX (must be a positive integer) [d/DESCRIPTION] [t/TAG]…
Example: edit 1 d/A funny meme t/funny
(The text in the command box will turn red to indicate invalid input)
-