From 59eab842de02b2b2ba8bf53e2214b558457e6356 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 24 Feb 2017 11:13:45 -0500 Subject: Added more casing options to tokens --- lib/token.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'lib/token.h') diff --git a/lib/token.h b/lib/token.h index a4072e0..6df2fb5 100644 --- a/lib/token.h +++ b/lib/token.h @@ -105,10 +105,17 @@ namespace verbly { // Transform + enum class casing { + normal, + capitalize, + all_caps, + title_case + }; + static token separator(std::string param, token inner); static token punctuation(std::string param, token inner); static token definiteArticle(token inner); - static token capitalize(token inner); + static token capitalize(casing param, token inner); token& getInnerToken(); const token& getInnerToken() const; @@ -118,7 +125,7 @@ namespace verbly { std::string compileHelper( std::string separator, bool definiteArticle, - bool capitalize) const; + casing capitalization) const; enum class transform_type { separator, @@ -132,6 +139,11 @@ namespace verbly { std::string param, token inner); + token( + transform_type type, + casing param, + token inner); + union { struct { word word_; @@ -143,7 +155,8 @@ namespace verbly { std::list utterance_; struct { transform_type type_; - std::string param_; + std::string strParam_; + casing casingParam_; std::unique_ptr inner_; } transform_; }; -- cgit 1.4.1