A sentence auto completer plugin for VIM with a file containing most frequent sentences. A C++ utility is used to get the most frequent sentences from a given data set.
Plugin was developed to ease up writing repeated JAMA automated test descriptions.
Most frequent sentences are collected using trie and heap data structure for faster performance and low memory foot print for large data sets.
- Compile automater.cpp
g++ automater.cpp -std=c++17 -lstdc++fs - Get the most frequent sentences from an existing folder
train_dataor freshly clone a repo from github you wish to collect most frequent lines from(set your appropriate github username and authtoken in the source file). Training data file pattern, description start/stop are hardcoded in the file which can be modified.
Sample command:
use existing train data without cloning any repo and get the top 100 frequent sentences.
./a.out none sanitizePatterns.txt 0 1 100- The output will be a file
mostFeqLines.txtcontaining tab separated sentences with frequency.
-
Filter the output from previous steps as per your requirement and create a file
most_freq_lines.txtwith the final list of sentences that will be used for VIM autocomplete. -
Make sure the plugin file
.vimandmost_freq_lines.txtare in the same directory. You can source it in.vimrcor source it using:source hari_autocomplete.vimfrom your current buffer. -
Once sourced use
:SSCto active the new omni function and:USSCto reset it. Completion can be triggered usingCtrl-x Ctrl-oin insert mode. Both the lines from current file andmost_freq_lines.txtare used in auto completion.