respace
1.0
|
#include <respacer.h>
Public Member Functions | |
respacer (std::string const &dictionary_path, std::string const &language_model_path) | |
std::vector< std::string > | respace (std::string const &letters) |
For a given string of letters and no spaces, returns the likeliest sequence of words.
For example, given "theappleisredandthebananaismushy", the likeliest sequence expected is "the apple is red and the banana is mushy".
Works by recursively using the given dictionary to find valid words at the head of the given string and then using the given language model to find the best scoring sequence of words.
|
inline |
dictionary_path | Path to a file containing list of words in alphabetical order, one word per line. |
language_model_path | Path to a language model file for lm::ngram::Model to use. |
|
inline |
Given a string of characters with no spaces, computes the most likely original sentence.
Invokes companion function. This way, we have a clean signature.
letters | A string of characters containing alphabetical characters exclusively. |