Lexicon Import

The lexicon import process imports the lexicon data from the structured data type in xml format. Whilst you import the xml file, you can choose either to overwrite or append the existing lexicon data.
By default, the import process appends the new translations (if any) to the existing file; however, you can select TRUNCATE to overwrite the existing entries with the new entries. This means the existing translations are lost, if they are not included in the new import file.  

To import xml file:

  1. Open PROIV Control Panel and click Virtual Machine.

  2. Expand Lexicon and then click Import/Export.
    The Import/Export page appears.

  3. To import the Lexicon data xml file, click Choose File.
    Browse and select the required xml.

    Select the Truncate check box to remove the existing data and add the new data in the lexicon database. However, if you do not select Truncate, the new data is appended to the old data in the lexicon database.

  4. Click Import.
    The xml file is imported and the lexicon data is stored in the server.

Lexicon Export

The lexicon export process creates the xml file with the existing lexicon data. The Translation IDs appears in the export file and you can refer to the ID for the current data. The ID is not required for an import; however, you can retain or amend if you require to maintain the file manually. If the ID is excluded or new entries are added, they are automatically assigned a new ID.

Whilst you enter translation IDs manually, each one must be unique. This applies to all the ID types, such as translation, lexicon_string and meaning.

To export lexicon data as xml file:

  1. Open PROIV Control Panel and click Virtual Machine.

  2. Expand Lexicon and then click Import/Export.
    The Import/Export page appears.

  3. To export the Lexicon data as xml file, click Export.
    The lexicon data is exported as xml file.

    You can also manually edit the xml file in case you want to add new entries, however, for the server to get updated, you must import back the xml file to the system.

Lexicon Export and Import using Command Line

To run the import/export manually, use the following command line entry and note that the folder must contain the NorthgateVirtualMachine.jar file.

Note: It is recommended to export large lexicon databases using command line to avoid web page timeouts.

java -cp NorthgateVirtualMachine.jar; <databaseJDBC.jar> com.northgateis.product.lexicon.utils.ImporterExporter <data.xml> [in/out] <lexicon-config.xml> [Y/N]

Note: You must use an appropriate separator for the jar files in the above mentioned syntax. Use " ; " on windows environment and " : " on UNIX environment.

<databaseJDBC.jar>

This is the JDBC file that JAVA needs to be able to communicate to the database. It should be one of the following, dependent on database type:

<data.xml> is the xml file that contain all the strings and translations

[in/out]

Use in to import, out to export.

UTF-16 to UTF-8 Conversion

If the Lexicon Export file does not display as expected, it may be that the xml file needs converting to UTF-8.

The following example demonstrates the conversion command:

iconv -f utf-16 -t utf-8 data.xml > data_conv.xml

 

<lexicon-config.xml>

This is the config file that java uses with the lexicon. You can copy from the folder /virtual_machine/javalib of the target machine.

[Y/N]

Y - Truncates the existing data from the lexicon database during the import process

N - Appends the lexicon data to the existing data in the database during the import process.

Section links:

Editing the Lexicon Export File outlines the areas of the Lexicon Export XML file which you can edit as a translator.

Comment on this topic

Topic ID: 480004