@@ -287,9 +287,10 @@ namespace Tokenizer {
287
287
outputclass (" current" ),
288
288
text_cat ( 0 )
289
289
{
290
- theErrLog = new TiCC::LogStream (cerr, " ucto" );
290
+ theErrLog = new TiCC::LogStream (cerr);
291
+ theErrLog->set_message ( " ucto" );
291
292
theDbgLog = theErrLog;
292
- theErrLog->setstamp ( StampMessage );
293
+ theErrLog->set_stamp ( StampMessage );
293
294
}
294
295
295
296
TokenizerClass::~TokenizerClass (){
@@ -1000,7 +1001,7 @@ namespace Tokenizer {
1000
1001
// there is already text at thus level, bail out.
1001
1002
return ;
1002
1003
}
1003
- if ( root->isSubClass ( folia::Linebreak_t ) ){
1004
+ if ( root->isSubClass < folia::Linebreak>( ) ){
1004
1005
// exception
1005
1006
return ;
1006
1007
}
@@ -1217,7 +1218,7 @@ namespace Tokenizer {
1217
1218
}
1218
1219
else {
1219
1220
const folia::FoliaElement *par = el->parent ();
1220
- if ( par->element_id () == folia::BASE ){
1221
+ if ( par->isinstance < folia::FoLiA>() ){
1221
1222
// we went all up without avail...
1222
1223
return " " ;
1223
1224
}
@@ -1307,7 +1308,7 @@ namespace Tokenizer {
1307
1308
}
1308
1309
else if ( (tok.role & BEGINOFSENTENCE)
1309
1310
&& root != sent
1310
- && root->element_id () == folia::Sentence_t ){
1311
+ && root->isinstance < folia::Sentence>() ){
1311
1312
// Ok, another Sentence in a quote
1312
1313
if ( i > 0 && !(toks[i-1 ].role & BEGINQUOTE) ){
1313
1314
// close the current one, and start a new one.
@@ -1433,7 +1434,7 @@ namespace Tokenizer {
1433
1434
args[" set" ] = root->doc ()->default_set ( folia::AnnotationType::PARAGRAPH );
1434
1435
args[" xml:id" ] = root->doc ()->id () + " .p." + TiCC::toString (++p_count);
1435
1436
folia::Paragraph *p = new folia::Paragraph ( args, root->doc () );
1436
- if ( root->element_id () == folia::Text_t ){
1437
+ if ( root->isinstance < folia::Text>() ){
1437
1438
if ( tokDebug > 5 ){
1438
1439
DBG << " append_to_folia, add paragraph to Text" << endl;
1439
1440
}
@@ -1674,10 +1675,11 @@ namespace Tokenizer {
1674
1675
int & sentence_done ){
1675
1676
// a Paragraph may contain both Word and Sentence nodes
1676
1677
// Sentences will be handled
1677
- vector<folia::Sentence*> sv = p->select <folia::Sentence>(false );
1678
+ vector<folia::Sentence*> sv
1679
+ = p->select <folia::Sentence>(folia::SELECT_FLAGS::LOCAL);
1678
1680
if ( sv.empty () ){
1679
1681
// No Sentence, so just text or Words
1680
- vector<folia::Word*> wv = p->select <folia::Word>(false );
1682
+ vector<folia::Word*> wv = p->select <folia::Word>(folia::SELECT_FLAGS::LOCAL );
1681
1683
if ( !wv.empty () ){
1682
1684
vector<folia::FoliaElement*> ev ( wv.begin (), wv.end () );
1683
1685
// Words found
@@ -1777,8 +1779,10 @@ namespace Tokenizer {
1777
1779
// maybe <div> or <note> or such
1778
1780
// there may be embedded Paragraph, Word and Sentence nodes
1779
1781
// if so, Paragraphs and Sentences should be handled separately
1780
- vector<folia::Sentence*> sv = e->select <folia::Sentence>(false );
1781
- vector<folia::Paragraph*> pv = e->select <folia::Paragraph>(false );
1782
+ vector<folia::Sentence*> sv
1783
+ = e->select <folia::Sentence>(folia::SELECT_FLAGS::LOCAL);
1784
+ vector<folia::Paragraph*> pv
1785
+ = e->select <folia::Paragraph>(folia::SELECT_FLAGS::LOCAL);
1782
1786
if ( pv.empty () && sv.empty () ){
1783
1787
// just words or text
1784
1788
UnicodeString text = e->unicode ( text_policy );
@@ -1800,7 +1804,7 @@ namespace Tokenizer {
1800
1804
// multiple sentences. We need an extra Paragraph.
1801
1805
// But first check if this is allowed!
1802
1806
folia::FoliaElement *rt;
1803
- if ( e->acceptable ( folia::Paragraph_t ) ){
1807
+ if ( e->acceptable < folia::Paragraph>( ) ){
1804
1808
folia::KWargs args;
1805
1809
string e_id = e->id ();
1806
1810
if ( !e_id.empty () ){
0 commit comments