Skip to content

Adaptation and translation of OPSIN: Open Parser for Systematic IUPAC Nomenclature

Notifications You must be signed in to change notification settings

quimifyapp/opsin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quimify Opsin

Overview

Quimify Opsin is an adaptation and translation to Spanish of OPSIN (Open Parser for Systematic IUPAC Nomenclature), a powerful parser for systematic IUPAC nomenclature. This project is intended to facilitate the generation of chemical structures from systematic IUPAC names in Spanish, and is used in Quimify as a library of quimifyapp/organic.

Usage Examples

Paralell, from an English and a Spanish name:

Build it:

String englishName = "2-methylpropanoic acid";
OpsinEnglish opsinEnglish = new OpsinEnglish(englishName);
String spanishName = "ácido 2-metilpropanoico";
OpsinSpanish opsinSpanish = new OpsinSpanish(spanishName);

Result:

if (opsinEnglish.isPresent()) {
    opsinEnglish.getSmiles(); // CC(C(=O)O)C
    opsinEnglish.getCml(); // Chemical Markup Language (too long)
}
if (opsinSpanish.isPresent()) {
    opsinSpanish.getSmiles(); // CC(C(=O)O)C
    opsinSpanish.getCml(); // Chemical Markup Language (too long)    
}

How it works

Pre processing

Done before parsing names with OPSIN. For instance:

diethyl etherethyl ether

Translation

Done by editing resource files. For instance:

.../english/resources/functionalTerms.xml

<token value="[Br-]">bromide|bromid</token>
<token value="[Cl-]">chloride|chlorid</token>

.../spanish/resources/functionalTerms.xml

<token value="[Br-]">bromuro|brom</token><!--TRANSLATED-->
<token value="[Cl-]">cloruro|clor</token><!--TRANSLATED-->

Usage

Clone the repository and run Main from module quimify-opsin-english or quimify-opsin-spanish using Java 11.

Installation

To use Quimify Opsin in your project, you can generate a JAR file with dependencies by running the Maven task package with the command mvn package. The JAR files will be located at quimify-opsin-english/target and quimify-opsin-spanish/target respectively.

Alternatively, download the latest release available.

Dependencies

Quimify OPSIN uses the opsin-core module from OPSIN.

License?

Do whatever you want with this code.

However, please be aware that our code relies on open-source dependencies, each with their own licenses and usage terms. Non-compliance with their licenses could have legal consequences.

About

Adaptation and translation of OPSIN: Open Parser for Systematic IUPAC Nomenclature

Resources

Stars

Watchers

Forks

Languages