Skip to content

Commit f23a522

Browse files
committed
small fix after merge
1 parent 83f4428 commit f23a522

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

.github/workflows/ucto.yml

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- master
8+
- develop
89

910
paths:
1011
- 'src/**'
@@ -45,10 +46,12 @@ jobs:
4546

4647
- uses: LanguageMachines/ticcactions/cpp-submodule-build@v1
4748
with:
49+
branch: ${{ github.ref_name }}
4850
module: ticcutils
4951

5052
- uses: LanguageMachines/ticcactions/cpp-submodule-build@v1
5153
with:
54+
branch: ${{ github.ref_name }}
5255
module: libfolia
5356

5457
- uses: LanguageMachines/ticcactions/cpp-submodule-build@v1

src/tokenize.cxx

+15-11
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,10 @@ namespace Tokenizer {
287287
outputclass("current"),
288288
text_cat( 0 )
289289
{
290-
theErrLog = new TiCC::LogStream(cerr, "ucto" );
290+
theErrLog = new TiCC::LogStream(cerr);
291+
theErrLog->set_message( "ucto" );
291292
theDbgLog = theErrLog;
292-
theErrLog->setstamp( StampMessage );
293+
theErrLog->set_stamp( StampMessage );
293294
}
294295

295296
TokenizerClass::~TokenizerClass(){
@@ -1000,7 +1001,7 @@ namespace Tokenizer {
10001001
// there is already text at thus level, bail out.
10011002
return;
10021003
}
1003-
if ( root->isSubClass( folia::Linebreak_t ) ){
1004+
if ( root->isSubClass<folia::Linebreak>() ){
10041005
// exception
10051006
return;
10061007
}
@@ -1217,7 +1218,7 @@ namespace Tokenizer {
12171218
}
12181219
else {
12191220
const folia::FoliaElement *par = el->parent();
1220-
if ( par->element_id() == folia::BASE ){
1221+
if ( par->isinstance<folia::FoLiA>() ){
12211222
// we went all up without avail...
12221223
return "";
12231224
}
@@ -1307,7 +1308,7 @@ namespace Tokenizer {
13071308
}
13081309
else if ( (tok.role & BEGINOFSENTENCE)
13091310
&& root != sent
1310-
&& root->element_id() == folia::Sentence_t ){
1311+
&& root->isinstance<folia::Sentence>() ){
13111312
// Ok, another Sentence in a quote
13121313
if ( i > 0 && !(toks[i-1].role & BEGINQUOTE) ){
13131314
// close the current one, and start a new one.
@@ -1433,7 +1434,7 @@ namespace Tokenizer {
14331434
args["set"] = root->doc()->default_set( folia::AnnotationType::PARAGRAPH );
14341435
args["xml:id"] = root->doc()->id() + ".p." + TiCC::toString(++p_count);
14351436
folia::Paragraph *p = new folia::Paragraph( args, root->doc() );
1436-
if ( root->element_id() == folia::Text_t ){
1437+
if ( root->isinstance<folia::Text>() ){
14371438
if ( tokDebug > 5 ){
14381439
DBG << "append_to_folia, add paragraph to Text" << endl;
14391440
}
@@ -1674,10 +1675,11 @@ namespace Tokenizer {
16741675
int& sentence_done ){
16751676
// a Paragraph may contain both Word and Sentence nodes
16761677
// 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);
16781680
if ( sv.empty() ){
16791681
// 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);
16811683
if ( !wv.empty() ){
16821684
vector<folia::FoliaElement*> ev( wv.begin(), wv.end() );
16831685
// Words found
@@ -1777,8 +1779,10 @@ namespace Tokenizer {
17771779
// maybe <div> or <note> or such
17781780
// there may be embedded Paragraph, Word and Sentence nodes
17791781
// 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);
17821786
if ( pv.empty() && sv.empty() ){
17831787
// just words or text
17841788
UnicodeString text = e->unicode( text_policy );
@@ -1800,7 +1804,7 @@ namespace Tokenizer {
18001804
// multiple sentences. We need an extra Paragraph.
18011805
// But first check if this is allowed!
18021806
folia::FoliaElement *rt;
1803-
if ( e->acceptable(folia::Paragraph_t) ){
1807+
if ( e->acceptable<folia::Paragraph>() ){
18041808
folia::KWargs args;
18051809
string e_id = e->id();
18061810
if ( !e_id.empty() ){

0 commit comments

Comments
 (0)