Vim4notes

From UBC Wiki

Authors: Sofia Daschle, Rudy Ma, Andrew Black

What is the problem?

When taking notes in class, it is important to use a system that is quick, responsive, and with a lack of distractions to allow your focus to remain on the lecture. Our project will be implementing a text editing/notetaking application meant to help streamline the notetaking process for school. The application will use features akin to Vim, allowing users to edit and organize their notes without the use of a mouse, and it will feature a simple text based UI. It will utilize keyboard commands and special key presses to do things like creating new note documents, or editing large sections of text. We also plan on using a node and tree system to organize how the notes are displayed and saved.

What is the something extra?

The 'something extra' we added was an autocorrect feature, that will figure out which words in the note are the most likely to be misspelled and suggest corrections. The user can then choose a correction from the list, keep the original word, or manually fix a typo. While some of the mathematical functions for determining edit distance are based on a project by github user doersino (citation in code), the functionality was done by us.

What did we learn from doing this?

For some parts of this task, there was a learning curve to using functional programming.

When writing the spellcheck feature, we had to be creative in determining how to use our dataset without the use of global objects. Rather than processing the data upon starting the app and storing the same object to be used while the app is running, we ended up doing preprocessing. We processed the data into a Map type, then wrote this to a file, so that it could be quickly loaded anytime that the data was needed. If we had more time for this project, we would have liked to implement some ML-inspired features, so that the program can learn if particular words are more likely for a given 'Notebook' subject, for example.

When looking for ways to implement an UI into Haskell, we looked to external libraries that aided in creating TUI's in Haskell. Through this process, we found Cabal, an infrastructure for organizing and distributing various libraries made for Haskell. We learned how to implement additional libraries through Cabal, which involves creating a .cabal file with dependencies listed within it for each library we want to add. Additionally, we had to properly manage and use the new libraries we installed, identifying which functions could be accomplished easier using a library or with base Haskell and merging the two.

Work division

Sofia: Note and Notebook types, functions, object storage and writing; found dataset, wrote Spellcheck functions to process, store, and use the data; wrote Spellchecker functions to integrate this with the rest of the application.

Rudy: Control flow functions for navigating the UI, "key listener" functions, menu, navigation, writing, and file event functions; Helped implement external library (Brick) for UI implementation

Links to code etc.

https://github.com/andrew-bdev/vim4notes2