Project

termium

0.0
The project is in a healthy, maintained state
Parser for the TERMIUM Plus terminology database of the Government of Canada
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.14.0
~> 13.0
~> 3.10

Runtime

>= 0
>= 0
 Project Readme

Termium Ruby gem

Purpose

The Termium Ruby gem parses export data formats from the 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

$ termium convert -i INPUT_XML_FILE [-o OUTPUT_PATH]

Options

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.

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 Ribose Inc.

License

The gem is available as open source under the terms of the 2-Clause BSD License.