sammthomson/semafor — pull request #8 by vanatteveldt (2014-05-15 21:13:44+00:00)
Title: Interactive mode

I added an interactive mode so you can run semafor as a sub process and communicate with it over pipes, which is easier to manage if you want to start semafor from a different process (e.g. pipelining software).

Input uses the SentenceIterator, so CONLL files separated by blank lines. Processing happens immediately after a blank line.

Note that it throws a fatal error if more than one blank line is given, but this is a 'feature' of SentenceIterator.

Example session at https://gist.github.com/vanatteveldt/6a8e4e4fcf70e2608aa1. It immediately provides a parse after each input sentence, and recovers gracefully from a processing error.

(this was actually quite simple because the sentenceiterator really does all the hard work, so the difference from the socket server is quite minimal)

Legal: This is an irrevocable offer to transfer the copyright of the code contained in this and all my future and past commits to this repository to Samm Thomson or any person organization designated by him in return for licensing the code to me under terms of an OSI approved license.