Skip to content

Commit

Permalink
Use the PT class to see if something can be an element and removing t…
Browse files Browse the repository at this point in the history
…he redundant element symbol info

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Aug 29, 2010
1 parent 9eb04e5 commit 937c4c7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/org/openscience/cdk/smiles/SmilesParser.java
Expand Up @@ -42,22 +42,23 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IAtomType.Hybridization;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IBond.Order;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.ITetrahedralChirality;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IPseudoAtom;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IAtomType.Hybridization;
import org.openscience.cdk.interfaces.IBond.Order;
import org.openscience.cdk.interfaces.ITetrahedralChirality;
import org.openscience.cdk.interfaces.ITetrahedralChirality.Stereo;
import org.openscience.cdk.stereo.TetrahedralChirality;
import org.openscience.cdk.tools.CDKHydrogenAdder;
import org.openscience.cdk.tools.ILoggingTool;
import org.openscience.cdk.tools.LoggingToolFactory;
import org.openscience.cdk.tools.manipulator.AtomTypeManipulator;
import org.openscience.cdk.tools.manipulator.BondManipulator;
import org.openscience.cdk.tools.periodictable.PeriodicTable;

/**
* Parses a SMILES {@cdk.cite SMILESTUT} string and an AtomContainer. The full
Expand Down Expand Up @@ -643,10 +644,7 @@ private String getElementSymbol(String s, int pos)
{
String possibleSymbol = s.substring(pos, pos + 2);
logger.debug("possibleSymbol: ", possibleSymbol);
if (("HeLiBeNeNaMgAlSiClArCaScTiCrMnFeCoNiCuZnGaGeAsSe".indexOf(possibleSymbol) >= 0) ||
("BrKrRbSrZrNbMoTcRuRhPdAgCdInSnSbTeXeCsBaLuHfTaRe".indexOf(possibleSymbol) >= 0) ||
("OsIrPtAuHgTlPbBiPoAtRnFrRaLrRfDbSgBhHsMtDs".indexOf(possibleSymbol) >= 0))
{
if (PeriodicTable.getAtomicNumber(possibleSymbol) != null) {
return possibleSymbol;
}
}
Expand Down

0 comments on commit 937c4c7

Please sign in to comment.