Browse Source

fix prevSize = 0

master
François 5 months ago
parent
commit
73a00e3528
  1. 7
      cpp/Context.cpp
  2. 2
      cpp/TextProdChar.cpp
  3. 1
      include/Context.hpp

7
cpp/Context.cpp

@ -9,10 +9,15 @@
using namespace std;
// ========================================
const int Context::prevSize (10);
const int Context::prevSize (16);
const string Context::end (".?!");
const string Context::sep (" ,;’-");
int
Context::getPrevSize () {
return prevSize;
}
bool
Context::validChar (const char &c) {
if (isalpha (c))

2
cpp/TextProdChar.cpp

@ -76,6 +76,8 @@ TextProdChar::prod (ostream &out, const long &size) {
if (maj)
boost::to_upper (next);
out << next;
if (end && ! Context::getPrevSize ())
break;
if (context.isEnd (next) ||
(nl && context.isSep (next))) {
out << endl;

1
include/Context.hpp

@ -20,6 +20,7 @@ class Context {
static const string end;
static const string sep;
public:
static int getPrevSize ();
static bool validChar (const char &c);
static bool isEnd (const string &c);
static bool isSep (const string &c);

Loading…
Cancel
Save