fix prevSize = 0

This commit is contained in:
François 2023-12-10 07:20:40 +01:00
parent 3e44eb5340
commit 73a00e3528
3 changed files with 9 additions and 1 deletions

View File

@ -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))

View File

@ -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;

View File

@ -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);