uk.ac.ebi.intenz.tools.sib.translator
Class XCharsASCIITranslator

java.lang.Object
  extended by uk.ac.ebi.intenz.tools.sib.translator.XCharsASCIITranslator

public class XCharsASCIITranslator
extends Object

This class translates ENZYME data into the IntEnz format and vice versa.

The rules applied can be found in the rules package (see also: RuleGroup).

Version:
$Revision: 1.2 $ $Date: 2008/11/11 12:01:24 $
Author:
Michael Darsow

Method Summary
static XCharsASCIITranslator getInstance()
          Returns the sole instance of this class.
 String toASCII(String text, boolean useReactionRules)
          Deprecated. Use toAscii(String text, boolean useReactionRules, boolean useDeLineRules)
 String toASCII(String text, boolean useReactionRules, boolean useDeLineRules)
          Translates a XChars encoded string into its ASCII representation.
 String toASCII(String text, boolean useReactionRules, boolean useDeLineRules, boolean useGrammarRules)
          Translates a XChars encoded string into its ASCII representation.
 List toXCharsFormat(List texts, boolean useReactionRules)
          Just calls toXCharsFormat(String, boolean) method for each item.
 String toXCharsFormat(String text, boolean useReactionRules)
          Translates a string into the IntEnz format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static XCharsASCIITranslator getInstance()
Returns the sole instance of this class.

Returns:
the sole instance of this class.

toXCharsFormat

public String toXCharsFormat(String text,
                             boolean useReactionRules)
Translates a string into the IntEnz format.

Parameters:
text - String to translate.
useReactionRules - Set to true if a reaction should be translated
Returns:
the translated string.
Throws:
NullPointerException - if text is null.

toXCharsFormat

public List toXCharsFormat(List texts,
                           boolean useReactionRules)
Just calls toXCharsFormat(String, boolean) method for each item.

Parameters:
texts - List of strings.
useReactionRules - Set to true if a reaction should be translated
Returns:
a list of translated strings.
Throws:
NullPointerException - if texts is null.

toASCII

public String toASCII(String text,
                      boolean useReactionRules)
Deprecated. Use toAscii(String text, boolean useReactionRules, boolean useDeLineRules)

Translates a XChars encoded string into its ASCII representation.

Parameters:
text - The string to be translated.
useReactionRules - true, if specific reaction rules should be applied to the translation process.
Returns:
the ASCII representation.
Throws:
NullPointerException - if texts is null.

toASCII

public String toASCII(String text,
                      boolean useReactionRules,
                      boolean useDeLineRules)
Translates a XChars encoded string into its ASCII representation.

Parameters:
text - The string to be translated.
useReactionRules - true, if specific reaction rules should be applied to the translation process.
Returns:
the ASCII representation.
Throws:
NullPointerException - if texts is null.

toASCII

public String toASCII(String text,
                      boolean useReactionRules,
                      boolean useDeLineRules,
                      boolean useGrammarRules)
Translates a XChars encoded string into its ASCII representation.

Parameters:
text - The string to be translated.
useReactionRules - use the reaction rules?
useDeLineRules - use the DE line rules?
useGrammarRules - use the grammar rules?
Returns:


Copyright © 2013 EMBL-EBI. All Rights Reserved.