chemaxon.formats.recognizer
Class SMILESRecognizer

java.lang.Object
  extended by chemaxon.formats.recognizer.Recognizer
      extended by chemaxon.formats.recognizer.SMILESRecognizer

public class SMILESRecognizer
extends Recognizer

SMILES/SMARTS/CxSMILES/CxSMARTS format recognizer.

Since:
Marvin 5.0, 06/07/2007
Version:
5.1, 07/29/2008
Author:
Peter Csizmadia

Constructor Summary
SMILESRecognizer(java.lang.String fmt)
          Creates a SMILES, SMARTS, CxSMILES or CxSMARTS format recognizer.
 
Method Summary
static boolean canBeSMARTS(java.lang.String s)
          Tests whether a string can be SMARTS.
static boolean canBeSMILES(java.lang.String s)
          Tests whether a string can be SMILES.
static boolean isComment(java.lang.String s)
           
 boolean needsMore()
          Should we read more lines?
 void tryToRecognize(java.lang.String line, int linenum, RecognizerList reclist)
          Tries to recognize a line.
 
Methods inherited from class chemaxon.formats.recognizer.Recognizer
getLastProcessedLineNum, getPriority, isLastLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMILESRecognizer

public SMILESRecognizer(java.lang.String fmt)
Creates a SMILES, SMARTS, CxSMILES or CxSMARTS format recognizer.

Parameters:
fmt - the codename of the format
Method Detail

tryToRecognize

public void tryToRecognize(java.lang.String line,
                           int linenum,
                           RecognizerList reclist)
Tries to recognize a line. If a format becomes impossible, then it is removed from the set of possible formats.

Specified by:
tryToRecognize in class Recognizer
Parameters:
line - the line
linenum - the line number
reclist - the list of recognizers

needsMore

public boolean needsMore()
Should we read more lines?

Specified by:
needsMore in class Recognizer
Returns:
true if more lines are needed, false otherwise

canBeSMILES

public static boolean canBeSMILES(java.lang.String s)
Tests whether a string can be SMILES.

Parameters:
s - the input string
Returns:
true if it can be, false if it cannot be SMILES

canBeSMARTS

public static boolean canBeSMARTS(java.lang.String s)
Tests whether a string can be SMARTS.

Parameters:
s - the input string
Returns:
true if it can be, false if it cannot be SMARTS.

isComment

public static boolean isComment(java.lang.String s)