@@ -561,7 +561,7 @@ folia::FoliaElement* FrogAPI::start_document( const string& id,
561561 folia::KWargs args;
562562 args[" xml:id" ] = doc->id () + " .text" ;
563563 folia::Text *text = new folia::Text ( args );
564- doc->setRoot ( text );
564+ doc->addText ( text );
565565 return text;
566566}
567567
@@ -632,10 +632,12 @@ folia::FoliaElement *FrogAPI::append_to_folia( folia::FoliaElement *root,
632632 }
633633 folia::LangAnnotation *la = new folia::LangAnnotation ( args, root->doc () );
634634 s->append ( la );
635- string text = fd.sentence (); // get tokenized, space separated, sentence.
636- text = TiCC::trim ( text );
637- if ( !text.empty () ){
638- s->settext ( text );
635+ if ( options.textredundancy == " full" ){
636+ string text = fd.sentence (false ); // get detokenized sentence.
637+ text = TiCC::trim ( text );
638+ if ( !text.empty () ){
639+ s->settext ( s->str (options.outputclass ), options.outputclass );
640+ }
639641 }
640642 }
641643 else {
@@ -1595,7 +1597,7 @@ void FrogAPI::run_folia_processor( const string& infilename,
15951597 if ( xmlOutFile.empty () ){
15961598 options.noStdOut = false ;
15971599 }
1598- folia::TextProcessor proc ( infilename );
1600+ folia::TextEngine proc ( infilename );
15991601 if ( !options.doTok ){
16001602 proc.declare ( folia::AnnotationType::TOKEN, " passthru" ,
16011603 " annotator='ucto', annotatortype='auto', datetime='now()'" );
0 commit comments