DESCRIPTION:
============

Elefas is a long-term translation memory: once segments are registered, they should not be removed.

It is not designed to be used via a CAT tool, data should be retrieved in batch mode 
into a TMX file which you can then import in your favorite CAT tool.

This package contains a web interface (HTML and REST) to upload and query the database.
It depends from the command-line package and does not work without it.

INSTALLATION:
=============

This is written using Perl framework named 'Dancer'. Look at http://www.perldancer.org/
and install Dancer library, with Database plugin, Perl-DBI and Perl-DBD::Pg 
Users of debian can install the package libdancer-perl, which will check for dependancies.
Don't be confused with Dancer2, which has some incompatibilities, we use Dancer version 1 from now.

This interface requires Elefas-SQL package. In the future it may be compatible with other similar packages.
In config.yml you must adapt the following parameters:
- ef-binaries/location: where you have put the Elefas-SQL package, path to the binaries
- dataase: parameters of the database you want to use (note: the web interface will not create the database)

The deamon is a script which enables to distribute the load of the server: instead of executing your query immediately,
this is put in a queue and the deamon starts it when it has enough time.
If you want to use it, simply configure the 'deamon' set of values, like this:
- must-start: whenever the web app must start it or if it is to be started elsewhere
- inmport-dir, search-input, search-result: directories for the deamon
If you don't want to use the deamon, remove completely this set of values, including 'deamon' header.

API:
====

If you want to use this interface as a developer, rather than with a browser, you can call the following functions:

- GET /api/upload?file=/some/file => will upload a TMX file. But you must put the file somewhere on server
- POST /api/upload => will upload a TMX file. The file must be directly in post contents. 
- POST /api/batch-search => will search for sentences and produce a TMX file in a directory. POST contents is a text file with one sentence per line

LICENSE:
========

Please read the file LICENSE for the very last version of conditions applied to this code.

