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, searches may be too slow for real time.
Instead, data should be retrieved in batch mode into a TMX file 
which you can then import in your favorite CAT tool.

This package contains the SQL code of the database, and command-line tools to insert or retreive data.
Tools for basic users (web interfaces, mail senders...) are out of the scope of this package.

INSTALLATION (MANUAL MODE):
===========================

You must install Postgresql database server, version 8.4 or more.
Create a catalog and run
1. sql/tables.sql, as the user which will have write access to the tables;
2. sql/indexes.sql, as a user with admin rights 
3. sql/functions.sql, as a user with admin rights 
No need to be in the server itself, however since the SQL code creates extensions,
you need to have full creation rights (including admin rights) to run this script.

Now you should go to the file config/elefas.yml and set the parameters to access the just created memory
(this is not mandatory but it makes connections easier)
You can also configure globally search parameters (how many results to display, match rate, etc.)
and the file containing segmentation rules (global or per-database)

INSTALLATION (GUIDED MODE):
===========================

You must install Postgresql database server, version 8.4 or more.

Now you should go to the file config/elefas.yml and set the parameters to access the desired database
(this is not mandatory but it makes connections easier)
You can also configure globally search parameters (how many results to display, match rate, etc.)
and the file containing segmentation rules (global or per-database)

Now, instead of creating the memories manually, you can use the script bin/ef-config.rb and its command init-db
(detailed syntax when you run the script without parameters)

USAGE:
======

To import data in the memory, use bin/ef-import.rb; data must be in TMX format.
Details about syntax are in the file itself and can be extracted using rdoc
Syntax:    ruby ef-import.rb "<db name>:<user>:<pass>:<host>:<port>" file.tmx
All connection parameters in one string separated by ':'; any parameter may be empty
As an alternative if you defined in previous section an alias to your database,
you can use '#alias' as parameter (no other parameter) and connection parameters will be read from config file.

To query the database, use bin/ef-find.rb; you can query either a single string
or a text file which must contain one segment (not full paragraph!) per line.
Details about syntax are displayed when you run the script without parameters.

The script ef-stats.rb gives statistics about number of collections, documents and segments.

The script ef-deamon.rb creates an infinite loop looking in two directories:
- import directory: when you put a TMX file here, it is imported using ef-import.rb, then deleted
- search input directory: when you put a text file here, a search is done,
  result TMX file is put in search result directory and input text file is deleted

LICENSE:
========

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

