presageDemo.cpp File Reference
`#include "presage.h"`
`#include <curses.h>`
`#include <getopt.h>`
`#include <iostream>`
`#include <sstream>`
`#include <list>`
Include dependency graph for presageDemo.cpp:

Go to the source code of this file.

## Classes

class | PresageDemoCallback

## Macros

#define | NOMACROS

## Functions

void | parseCommandLineArgs (int argc, char **argv)
void | printUsage ()
void | printVersion ()
void | disclaimer ()
void | draw_title_win (WINDOW *)
void | draw_context_win (WINDOW *, std::string)
void | draw_function_keys (WINDOW *)
void | draw_previous_suggestions (std::vector< std::string >, bool, const int, int)
size_t | getGreatestSuggestionLength (std::vector< std::string > suggestions)
int | main (int argc, char **argv)
void | drawMsgWin (WINDOW *win, std::vector< std::string > words)
void | parseCommandLineArgs (int argc, char *argv[])

## Variables

const char | PROGRAM_NAME [] = "presage_demo"
std::string | suggestions
std::string | config
std::stringstream | buffer

## Macro Definition Documentation

## NOMACROS

#define NOMACROS

Definition at line 34 of file presageDemo.cpp.

## Function Documentation

## disclaimer()

void disclaimer | ( |  | ) |

Definition at line 316 of file presageDemo.cpp.

## draw_context_win()

void draw_context_win | ( | WINDOW * | win,
|  | std::string | str
| ) |  |

Definition at line 211 of file presageDemo.cpp.

## draw_function_keys()

void draw_function_keys | ( | WINDOW * | win | ) |

Definition at line 236 of file presageDemo.cpp.

References suggestions.

## draw_previous_suggestions()

void draw_previous_suggestions | ( | std::vector< std::string > | words,
|  | bool | contextChange,
|  | const int | starty,
|  | int | startx
| ) |  |

Definition at line 248 of file presageDemo.cpp.

References getGreatestSuggestionLength(), and suggestions.

Here is the call graph for this function:

## draw_title_win()

void draw_title_win | ( | WINDOW * | title_win | ) |

Definition at line 350 of file presageDemo.cpp.

## drawMsgWin()

void drawMsgWin | ( | WINDOW * | win,
|  | std::vector< std::string > | words
| ) |  |

Definition at line 220 of file presageDemo.cpp.

## getGreatestSuggestionLength()

size_t getGreatestSuggestionLength | ( | std::vector< std::string > | suggestions | ) |

Definition at line 303 of file presageDemo.cpp.

References suggestions.

Referenced by draw_previous_suggestions().

Here is the caller graph for this function:

## main()

int main | ( | int | argc,
|  | char ** | argv
| ) |  |

Demo program using curses.

This demo displays the text entered in a top windows that stretches across the screen. The current prediction is displayed immediately underneath the text window, at the leftmost position.

The previous predictions are displayed in cronological order to the right of the current prediction.

Subsequent predictions shifted to the right, so that the current prediction is always on the left hand side. Context switches are marked in some way (either a vertical bar or a box enclosing the other prediction boxes).

Definition at line 113 of file presageDemo.cpp.

## parseCommandLineArgs() [1/2]

void parseCommandLineArgs | ( | int | argc,
|  | char ** | argv
| ) |  |

## parseCommandLineArgs() [2/2]

void parseCommandLineArgs | ( | int | argc,
|  | char * | argv[]
| ) |  |

Definition at line 361 of file presageDemo.cpp.

References config, printUsage(), printVersion(), and suggestions.

Here is the call graph for this function:

## printUsage()

void printUsage | ( |  | ) |

Definition at line 417 of file presageDemo.cpp.

References endl(), and PROGRAM_NAME.

Referenced by parseCommandLineArgs().

Here is the call graph for this function:
Here is the caller graph for this function:

## printVersion()

void printVersion | ( |  | ) |

Definition at line 408 of file presageDemo.cpp.

References endl(), and PROGRAM_NAME.

Referenced by parseCommandLineArgs().

Here is the call graph for this function:
Here is the caller graph for this function:

## Variable Documentation

## buffer

std::stringstream buffer

Definition at line 70 of file presageDemo.cpp.

Referenced by AbbreviationExpansionPredictor::cacheAbbreviationsExpansions(), and main().

## config

std::string config

Definition at line 69 of file presageDemo.cpp.

Referenced by AbbreviationExpansionPredictor::AbbreviationExpansionPredictor(), ARPAPredictor::ARPAPredictor(), ContextTracker::ContextTracker(), DejavuPredictor::DejavuPredictor(), DictionaryPredictor::DictionaryPredictor(), Profile::init_configuration(), parseCommandLineArgs(), presage_new_with_config(), Profile::read_into_configuration(), RecencyPredictor::RecencyPredictor(), Simulator::Simulator(), and SmoothedNgramPredictor::SmoothedNgramPredictor().

## PROGRAM_NAME

const char PROGRAM_NAME[] = "presage_demo"

Definition at line 51 of file presageDemo.cpp.

Referenced by printUsage(), and printVersion().

## suggestions

std::string suggestions

Definition at line 68 of file presageDemo.cpp.

Referenced by draw_function_keys(), draw_previous_suggestions(), getGreatestSuggestionLength(), and parseCommandLineArgs().