summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-11-08 11:36:50 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-11-08 11:36:50 -0500
commitc29f3645c9298dcb203f7414986604b89843e9ef (patch)
tree5578b1c4c825c455435c160fbcb5e7d02907c1ed /lib
parentbea545d62732fe048ca9cec7f82e4be1185cb87b (diff)
downloadverbly-c29f3645c9298dcb203f7414986604b89843e9ef.tar.gz
verbly-c29f3645c9298dcb203f7414986604b89843e9ef.tar.bz2
verbly-c29f3645c9298dcb203f7414986604b89843e9ef.zip
Renamed definiteArticle token to indefiniteArticle
Diffstat (limited to 'lib')
-rw-r--r--lib/token.cpp24
-rw-r--r--lib/token.h6
2 files changed, 16 insertions, 14 deletions
diff --git a/lib/token.cpp b/lib/token.cpp index 2fd6d44..88cc4da 100644 --- a/lib/token.cpp +++ b/lib/token.cpp
@@ -322,7 +322,7 @@ namespace verbly {
322 322
323 std::string token::compileHelper( 323 std::string token::compileHelper(
324 std::string separator, 324 std::string separator,
325 bool definiteArticle, 325 bool indefiniteArticle,
326 casing capitalization) const 326 casing capitalization) const
327 { 327 {
328 switch (type_) 328 switch (type_)
@@ -334,7 +334,7 @@ namespace verbly {
334 334
335 std::string result = wordForm.getText(); 335 std::string result = wordForm.getText();
336 336
337 if (definiteArticle) 337 if (indefiniteArticle)
338 { 338 {
339 if (wordForm.startsWithVowelSound()) 339 if (wordForm.startsWithVowelSound())
340 { 340 {
@@ -383,7 +383,7 @@ namespace verbly {
383 { 383 {
384 std::string result = literal_; 384 std::string result = literal_;
385 385
386 if (definiteArticle && std::isalpha(result[0])) 386 if (indefiniteArticle && std::isalpha(result[0]))
387 { 387 {
388 char canon = std::tolower(result[0]); 388 char canon = std::tolower(result[0]);
389 if ((canon == 'a') || (canon == 'e') || (canon == 'i') 389 if ((canon == 'a') || (canon == 'e') || (canon == 'i')
@@ -446,7 +446,7 @@ namespace verbly {
446 446
447 compiled.push_back( 447 compiled.push_back(
448 tkn.compileHelper(" ", 448 tkn.compileHelper(" ",
449 first && definiteArticle, 449 first && indefiniteArticle,
450 propagateCasing)); 450 propagateCasing));
451 451
452 first = false; 452 first = false;
@@ -462,25 +462,27 @@ namespace verbly {
462 case transform_type::separator: 462 case transform_type::separator:
463 { 463 {
464 return transform_.inner_->compileHelper( 464 return transform_.inner_->compileHelper(
465 transform_.strParam_, definiteArticle, capitalization); 465 transform_.strParam_, indefiniteArticle, capitalization);
466 } 466 }
467 467
468 case transform_type::punctuation: 468 case transform_type::punctuation:
469 { 469 {
470 return transform_.inner_->compileHelper( 470 return transform_.inner_->compileHelper(
471 separator, definiteArticle, capitalization) + transform_.strParam_; 471 separator, indefiniteArticle, capitalization)
472 + transform_.strParam_;
472 } 473 }
473 474
474 case transform_type::definite_article: 475 case transform_type::indefinite_article:
475 { 476 {
476 return transform_.inner_->compileHelper(separator, true, capitalization); 477 return transform_.inner_->compileHelper(
478 separator, true, capitalization);
477 } 479 }
478 480
479 case transform_type::capitalize: 481 case transform_type::capitalize:
480 { 482 {
481 return transform_.inner_->compileHelper( 483 return transform_.inner_->compileHelper(
482 separator, 484 separator,
483 definiteArticle, 485 indefiniteArticle,
484 transform_.casingParam_); 486 transform_.casingParam_);
485 } 487 }
486 } 488 }
@@ -660,9 +662,9 @@ namespace verbly {
660 return token(transform_type::punctuation, std::move(param), std::move(inner)); 662 return token(transform_type::punctuation, std::move(param), std::move(inner));
661 } 663 }
662 664
663 token token::definiteArticle(token inner) 665 token token::indefiniteArticle(token inner)
664 { 666 {
665 return token(transform_type::definite_article, "", std::move(inner)); 667 return token(transform_type::indefinite_article, "", std::move(inner));
666 } 668 }
667 669
668 token token::capitalize(casing param, token inner) 670 token token::capitalize(casing param, token inner)
diff --git a/lib/token.h b/lib/token.h index 6df2fb5..0bbe79a 100644 --- a/lib/token.h +++ b/lib/token.h
@@ -114,7 +114,7 @@ namespace verbly {
114 114
115 static token separator(std::string param, token inner); 115 static token separator(std::string param, token inner);
116 static token punctuation(std::string param, token inner); 116 static token punctuation(std::string param, token inner);
117 static token definiteArticle(token inner); 117 static token indefiniteArticle(token inner);
118 static token capitalize(casing param, token inner); 118 static token capitalize(casing param, token inner);
119 119
120 token& getInnerToken(); 120 token& getInnerToken();
@@ -124,13 +124,13 @@ namespace verbly {
124 124
125 std::string compileHelper( 125 std::string compileHelper(
126 std::string separator, 126 std::string separator,
127 bool definiteArticle, 127 bool indefiniteArticle,
128 casing capitalization) const; 128 casing capitalization) const;
129 129
130 enum class transform_type { 130 enum class transform_type {
131 separator, 131 separator,
132 punctuation, 132 punctuation,
133 definite_article, 133 indefinite_article,
134 capitalize 134 capitalize
135 }; 135 };
136 136