Skip to content

Commit

Permalink
Fixed error in decoding HTML/XML character entities
Browse files Browse the repository at this point in the history
  • Loading branch information
BartJongejan committed May 18, 2021
1 parent c7f32f6 commit ef09807
Show file tree
Hide file tree
Showing 9 changed files with 255 additions and 206 deletions.
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------
Version 8.1.2 (18 May 2021)
-------------------------------
Fixed error in decoding X/HTML entities, caused by calling virtual fnction from
inside a constructor.

-------------------------------
Version 8.1.1 (17 April 2021)
-------------------------------
Expand Down
46 changes: 27 additions & 19 deletions src/XMLtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ static void printXML(
fprintf(basefrm::m_fp,">");
break;
case '&':
if(strchr(s+1,';'))
/*if(strchr(s+1,';'))
fputc('&',basefrm::m_fp);
else
else*/
fprintf(basefrm::m_fp,"&");
break;
case '\'':
Expand Down Expand Up @@ -523,24 +523,32 @@ void XMLtext::reachedTokenEnd(char * Ch)
#if STREAM
XMLtext::XMLtext(istream * fpi,optionStruct & Option)
#else
XMLtext::XMLtext(FILE * fpi,optionStruct & Option)
XMLtext::XMLtext(FILE* fpi, optionStruct& Option)
#endif
:text(Option.InputHasTags, Option.nice)
, Token(NULL)
, ancestor(Option.ancestor)
, element(Option.element)
, segment(Option.segment)
, POSAttribute(Option.POSAttribute)
, lemmaAttribute(Option.lemmaAttribute)
, lemmaClassAttribute(Option.lemmaClassAttribute)
, Crumbs(NULL)
, ClosingTag(false)
, WordPosComing(false)
, POSPosComing(false)
, LemmaPosComing(false)
, LemmaClassPosComing(false)
, alltext(NULL)
, wordAttribute(Option.wordAttribute)
{
}

#if STREAM
void XMLtext::DoYourWork(istream* fpi, optionStruct& Option)
#else
void XMLtext::DoYourWork(FILE* fpi, optionStruct& Option)
#endif
:text(Option.InputHasTags,Option.nice)
,Token(NULL)
,ancestor(Option.ancestor)
,element(Option.element)
,segment(Option.segment)
,POSAttribute(Option.POSAttribute)
,lemmaAttribute(Option.lemmaAttribute)
,lemmaClassAttribute(Option.lemmaClassAttribute)
,Crumbs(NULL)
,ClosingTag(false)
,WordPosComing(false)
,POSPosComing(false)
,LemmaPosComing(false)
,LemmaClassPosComing(false)
,alltext(NULL)
,wordAttribute(Option.wordAttribute)
{
StartOfLine = true;

Expand Down
8 changes: 8 additions & 0 deletions src/XMLtext.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ class XMLtext : public text
*/
);
~XMLtext(){}
virtual void DoYourWork(
#if STREAM
istream* fpi
#else
FILE* fpi
#endif
, optionStruct& Option
);
virtual void printUnsorted(
#if STREAM
ostream * fpo
Expand Down
4 changes: 2 additions & 2 deletions src/cstlemma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ You should have received a copy of the GNU General Public License
along with CSTLEMMA; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define CSTLEMMAVERSION "8.1.1"
#define CSTLEMMADATE "2021.04.17"
#define CSTLEMMAVERSION "8.1.2"
#define CSTLEMMADATE "2021.05.18"
#define CSTLEMMACOPYRIGHT "2002-2021 Center for Sprogteknologi"

#include "lemmatiser.h"
Expand Down
Loading

0 comments on commit ef09807

Please sign in to comment.