Processing Basic Languages

It is important in Salience to think about the languages that you will be processing. This is never more important than when using Basic Languages.

This is due to the fact that you need to clearly indicate what languages you are using if you are using more than one language (using the -langs option).

Additionally if you are using manual management, it is important that you set up some sort of monitoring to ensure that the server is restarted should it go down.

Multiple Languages

Allowing Salience to manage server startup

// Thread 1 -- processing polish:
Salience session = new Salience(licensePath, "/opt/salience/data/pl-data-basic");
session.options.BasicLanguage.setManualBasicLanguageMangement(false);
session.options.BasicLanguage.setBasicLanguageServerOptions("-skip_ds -langs pl,th");
session.options.BasicLanguage.setBasicLanguageServerVersion("v4");
session.prepareText(...)
session.getDocumentSentiment(true)
... more polish docs ...

// Thread 2 -- processing thai
Salience session = new Salience(licensePath, "/opt/salience/data/th-data-basic");
session.options.BasicLanguage.setManualBasicLanguageMangement(false);
session.options.BasicLanguage.setBasicLanguageServerOptions("-skip_ds -langs pl,th");
session.options.BasicLanguage.setBasicLanguageServerVersion("v4");
session.prepareText(...)
session.getDocumentSentiment(true)
... more thai docs ...

Using externally managed server

// First start server from bash:
$ export REPUSTATE_HOME=$lxainstall/salience/BasicLanguages
$ cd $REPUSTATE_HOME
$ nohup ./repustate -skip_ds -langs pl,th > /var/log/repustate.log 2>&1 &

// Then in Java

// Thread 1 -- processing polish:
Salience session = new Salience(licensePath, "/opt/salience/data/pl-data-basic");
session.options.BasicLanguage.setManualBasicLanguageMangement(true);
session.options.BasicLanguage.setBasicLanguageServerVersion("v4");
session.prepareText(...)
session.getDocumentSentiment(true)
... more polish docs ...

// Thread 2 -- processing thai
Salience session = new Salience(licensePath, "/opt/salience/data/th-data-basic");
session.options.BasicLanguage.setManualBasicLanguageMangement(true);
session.options.BasicLanguage.setBasicLanguageServerVersion("v4");
session.prepareText(...)
session.getDocumentSentiment(true)
... more thai docs ...

Single Languages

Allowing Salience to manage server startup

Salience session = new Salience(licensePath, "/opt/salience/data/pl-data-basic");
session.options.BasicLanguage.setManualBasicLanguageMangement(false);
session.options.BasicLanguage.setBasicLanguageServerOptions("-skip_ds -langs pl");
session.options.BasicLanguage.setBasicLanguageServerVersion("v4");
session.prepareText(...)
session.getDocumentSentiment(true)
... more polish docs ...

Using externally managed server

// First start server from bash:
$ export REPUSTATE_HOME=$lxainstall/salience/BasicLanguages
$ cd $REPUSTATE_HOME
$ nohup ./repustate -skip_ds -langs pl > /var/log/repustate.log 2>&1 &

// Then in Java

Salience session = new Salience(licensePath, "/opt/salience/data/pl-data-basic");
session.options.BasicLanguage.setManualBasicLanguageMangement(true);
session.options.BasicLanguage.setBasicLanguageServerVersion("v4");
session.prepareText(...)
session.getDocumentSentiment(true)
... more polish docs ...