All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
text-utils.h File Reference
#include <errno.h>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <limits>
#include "base/kaldi-common.h"
Include dependency graph for text-utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 kaldi
 Relabels neural network egs with the read pdf-id alignments.
 

Functions

void SplitStringToVector (const std::string &full, const char *delim, bool omit_empty_strings, std::vector< std::string > *out)
 Split a string using any of the single character delimiters. More...
 
void JoinVectorToString (const std::vector< std::string > &vec_in, const char *delim, bool omit_empty_strings, std::string *str_out)
 Joins the elements of a vector of strings into a single string using "delim" as the delimiter. More...
 
template<class I >
bool SplitStringToIntegers (const std::string &full, const char *delim, bool omit_empty_strings, std::vector< I > *out)
 Split a string (e.g. More...
 
template<class F >
bool SplitStringToFloats (const std::string &full, const char *delim, bool omit_empty_strings, std::vector< F > *out)
 
template<class Int >
bool ConvertStringToInteger (const std::string &str, Int *out)
 Converts a string into an integer via strtoll and returns false if there was any kind of problem (i.e. More...
 
bool ConvertStringToReal (const std::string &str, double *out)
 ConvertStringToReal converts a string into either float or double via strtod, and returns false if there was any kind of problem (i.e. More...
 
bool ConvertStringToReal (const std::string &str, float *out)
 
void Trim (std::string *str)
 Removes the beginning and trailing whitespaces from a string. More...
 
void SplitStringOnFirstSpace (const std::string &line, std::string *first, std::string *rest)
 Removes leading and trailing white space from the string, then splits on the first section of whitespace found (if present), putting the part before the whitespace in "first" and the rest in "rest". More...
 
bool IsToken (const std::string &token)
 Returns true if "token" is nonempty, and all characters are printable and whitespace-free. More...
 
bool IsLine (const std::string &line)
 Returns true if "line" is free of
characters and unprintable characters, and does not contain leading or trailing whitespace. More...