Sha256: ad67d4b1bdab765e5e9c8941ee21deb11b7d707b7d70a893bc49f04495ea5ece

Contents?: true

Size: 1.43 KB

Versions: 4

Compression:

Stored size: 1.43 KB

Contents

= Termium Ruby gem

== Purpose

The Termium Ruby gem parses export data formats from the
https://www.btb.termiumplus.gc.ca[TERMIUM Plus]
terminology database service from the Government of Canada.


== Commands

`termium convert`:: Convert a TERMIUM Plus export XML file to a Glossarist dataset


=== Usage

[source,sh]
----
$ termium convert -i INPUT_XML_FILE [-o OUTPUT_PATH]
----

=== Options

[cols="a,a",options="header"]
|===
| Flag | Description

|`-i`, `--input-path`
|
Source path to TERMIUM Plus XML export file.
The file needs to start with the `<extract>` tag.

|`-o`, `--output-path`
|
Destination path to Glossarist dataset directory.
If the directory doesn't exist it will be created.
If not provided, defaults to the basename of the input file, e.g. `foo/bar.xml` will export to `foo/bar/`.

|===


== Library

=== Usage

This gem makes heavy use of the `Shale` classes for XML serialization.

The following code converts the Termium extract into a Glossarist dataset.

[source,ruby]
----
termium_extract = Termium::Extract.from_xml(IO.read(termium_extract_file))
glossarist_col = termium_extract.to_concept
FileUtils.mkdir_p(glossarist_output_file)
glossarist_col.save_to_files(glossarist_output_file)
----

== Credits

This gem is developed, maintained and funded by
https://www.ribose.com[Ribose Inc.]

== License

The gem is available as open source under the terms of the
https://opensource.org/licenses/BSD-2-Clause[2-Clause BSD License].

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
termium-0.1.4 README.adoc
termium-0.1.2 README.adoc
termium-0.1.1 README.adoc
termium-0.1.0 README.adoc