uchicago-cs / chiventure

A text adventure game engine developed in UChicago's CMSC 22000 - Introduction to Software Development
40 stars 13 forks source link

cli: Removing prepositions (and other "filler" words) from commands (current chiventure) #1452

Closed milesgardner closed 2 years ago

milesgardner commented 2 years ago

team members: Miles, Matteo, Faruk

In our current parsing framework, inputs into the command line are very strict. If a user wants to execute an action, they must write exactly what specific functions take. Otherwise, the command will not be parsed correctly and no action will be taken. For example, if a user types "go to the South" as opposed to "Go South", chiventure will report an error with command line.

milesgardner commented 2 years ago

I created the branch cli/remove-fillers where I will be working to create a function called remove_fillers. This function will be a helper to parse(), which parses the command line input and outputs an array of strings which are used as tokens. remove_fillers will remove all filler words inside of the parse() function, so the output is more accurate.

milesgardner commented 2 years ago

The helper function remove_fillers also accounts for when there are two fillers words, such as "go to the south," which is changed to "go south

milesgardner commented 2 years ago

I'm currently in discussion with Matteo. The remove_fillers function is complete - we are now in the phase of unit testing to make sure no issues will arise down the line. Additionally, we are heavily documenting this function, as it is an incredibly important one to completely understand for future CLI devs.

milesgardner commented 2 years ago

After more robust testing, we plan on submitting a PR today or tomorrow.

milesgardner commented 2 years ago

The implementation of remove_fillers() has been merged into dev. Matteo and I have written adequate testing, and plan on additionally adding documentation for further groups on how the general parsing structure operates. I worked on implementation, and Matteo worked on the testing.

jacknugent1529 commented 2 years ago

Issue Score: Excellent

Comments: Great work on this issue! Your comments are very detailed. One thing you can do is mark the PR as closing this issue, which makes it easier to follow what is happening