Automatic Blank Handling coding challenges
- Make the HTML format handler apertium-deshtml turn "foo bar" into "[{}]foo [{}]bar"
In this coding challenge we had to basically turn the link each word with its associated inline tag.
I have used python to code it and make use of the xml.dom library to parse the html/xml
I have further implemented the code using stack.
To compile and run :
python coding_challenge1.py
- Make apertium-deshtml not wrap tags like
or
in {} (ie. only for inline tags)
The 2nd challenge had to be done using language C++ as the entire apertium is built on C++.
It has the added functionality of not including the block tags in the [] brackets but only the inline tags.
To compile and run:
g++ libxml.cpp -I/usr/include/libxml2 -lxml2 -o output
It has a prerequisites of libxml2
To run the deformatter on your example.xml file run the following commands
- g++ deformatter.cpp -I/usr/include/libxml2 -lxml2 -o deform
- ./deform input.html
- g++ reformatter.cpp -std=c++11 -o reform
- ./reform > output.html