Authors: Yves Chan, Hai Hoang, Michael Wagler
What is the problem?
Many people want to learn how to use the popular text-editor vim, but are intimidated about where to start. VimMaster is the solution. VimMaster is a program that allows users to ask it their vim questions, such as "how do I copy a line?", or "how do I jump to the bottom of the page?", and it will provide them with the answers they need.
What is the something extra?
In addition to answering vim questions, VimMaster also has a tool that lets a user generate a vimrc (configuration) file based on what features they would like it to incorporate. For example, a user could specify that they want a vimrc file that turns line numbers on, automatically transforms tabs into spaces, turns on syntax highlighting, and automatically highlights all matching results of a search.
What did we learn from doing this?
Our program can take a wide range of questions about vim, such as "can you jump to the bottom of the file in vim"? and, based on certain keywords that have been passed in, it will provide the appropriate response. In the above example, it would notice the words 'jump', bottom', and 'file', and based on these constraints, would provide the answer that is associated with those attributes. in this case, the word 'jump' would match to an attribute called 'jump', 'bottom' would match to an attribute called 'end', and 'file' would match to an attribute called 'file'. However, if they had simply asked' "can you jump?", as this is a much more general question, they would receive several answers. In this case, they would receive information about jumping to the beginning or end of a word, of a line, of a paragraph, and of a file.
We also achieved the 'something extra' described above, and you can indeed generate a vimrc file. simply pass in a comma-separated sequence of desired features to the 'get_vimrc' predicate, and it will create it for you. For example, if you did 'get_vimrc("syntax highlighting, auto indent"), it would generate the corresponding vimrc file in the same folder in which you are running the program.
It seems that logic programming, in particular with prolog, seems to be a good fit for the task of creating a vim question answering application. For one, questions about the domain of vim tend to be quite structured and predictable, making prolog natural language processing a great fit for parsing and interpreting questions. It did not take long for us to devise a simple but flexible language processing system that allowed us to answer all the kinds of questions that we wished.