- download/install 'libxml' library.
- g++ -o challenge1
xml2-config --cflags
challenge-1.cppxml2-config --libs
- ./challenge1 input.html
Output would be:
[{<i>}]foo [{<b><i>}]bar
- g++ -o challenge2
xml2-config --cflags
challenge-2.cppxml2-config --libs
- ./challenge2 input.html
Input1:
<p>foo <b>bar fie <i>baz</i> fum</b> fiz</p>
Output1:
[<p>]foo [{<b>}]bar fie [{<i><b>}]baz[{<b>}] fum fiz[</p>]
Input2:
-
<p class="class1" id="id2"> <i>Hello Sir,</i> <u style="italic">would you <b>like to play</b> <em>football?</em></u> </p>
Updated Output2:
-
[<p class = "class1" id = "id2">] [{<i>}]Hello Sir, [{<u style = "italic">}]would you [{<b><u style = "italic">}]like to play[{<u style = "italic">}] [{<em><u style = "italic">}]football? [</p>]
[]```
- have some problem with dealing
</b>
in the input.
- $> make
- $> cat/echo file/"input string" |./dheshtml
or
./rehtml
<div id="id1">
<p class="class1" id="id2">
<i>Hello Sir,</i>
<u style="italic">would you
<b>like to play</b>
<em>football?</em></u>
</p>
</div>
<div id = "id1">]
[<p class = "class1" id = "id2">]
[{<i>}]Hello Sir,[]
[{<u style = "italic">}]would you
[{<b><u style = "italic">}]like to play[]
[{<em><u style = "italic">}]football?[][]
[][</p>]
[][</div>]
<p>foo <b>bar fie <i>baz</i> fum</b> fiz</p>
[<p>]foo [{<b>}]bar fie [{<i><b>}]baz[][{<b>}] fum[] fiz[][</p>]
[<div id = "id1">]
[<p class = "class1" id = "id2">]
[{<i>}]Hello Sir,[]
[{<u style = "italic">}]would you
[{<b><u style = "italic">}]like to play[]
[{<em><u style = "italic">}]football?[][]
[][</p>]
[][</div>]
<div id = "id1">
<p class = "class1" id = "id2">
<i>Hello Sir,</i>
<u style = "italic">]would you</u>
<b><u style = "italic">]like to play</u></b>
<em><u style = "italic">]football?</u></em>
</p>
</div>
[{<i>}]foo [{<b><i>}]bar[][]
<i>foo </i><b><i>bar</i></b>
- stay in the ./apertium directory.
- $> python run_test.py