Apertium

Write a program that adds slashes to Apertium biltrans stream

Write a program that reads an Apertium biltrans stream:

^El /The $ ^grup /group $ ^de /of /from $ ^el /the $ ^Parlament /Parliament $ ^haver /have $ ^mostrar /show /display $ ^aquest /this $ ^dimarts /Tuesday $ ^el seu /his $ ^suport /support $ ^a /at /in /to $ ^el /the $ ^batle/batle$

...and adds a slash to the end of every word, like that:

^El /The /$ ^grup /group /$ ^de /of /from /$ ^el /the /$ ^Parlament /Parliament /$ ^haver /have /$ ^mostrar /show /display /$ ^aquest /this /$ ^dimarts /Tuesday /$ ^el seu /his /group /$ ^suport /support /$ ^a /at /in /to /$ ^el /the /$ ^batle/batle/$

The program should either use streamparser[1] or process input character by character. It should read from stdin and write to stdout.

  1. https://github.com/goavki/streamparser

Task tags

  • python

Students who completed this task

Alexander Mamaev

Task type

  • code Code

Level

Beginner
close

2017