From 3ec1480b86f209009dc8cb85c0919ce487b84478 Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Fri, 27 Aug 2010 20:52:20 +0200 Subject: [PATCH] Upper case the first character to also properly recognize lower cased 'aromatic' two-character element symbols (fixes SMILES parsign of things like c1[se]ccccc1 Signed-off-by: Rajarshi Guha --- src/main/org/openscience/cdk/smiles/SmilesParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/org/openscience/cdk/smiles/SmilesParser.java b/src/main/org/openscience/cdk/smiles/SmilesParser.java index 91627786292..3c0be73971e 100644 --- a/src/main/org/openscience/cdk/smiles/SmilesParser.java +++ b/src/main/org/openscience/cdk/smiles/SmilesParser.java @@ -549,7 +549,7 @@ private String getElementSymbol(String s, int pos) // first, the two char elements if (pos < s.length() - 1) { - String possibleSymbol = s.substring(pos, pos + 2); + String possibleSymbol = ("" + s.charAt(pos)).toUpperCase() + s.charAt(pos + 1); logger.debug("possibleSymbol: ", possibleSymbol); if (("HeLiBeNeNaMgAlSiClArCaScTiCrMnFeCoNiCuZnGaGeAsSe".indexOf(possibleSymbol) >= 0) || ("BrKrRbSrZrNbMoTcRuRhPdAgCdInSnSbTeXeCsBaLuHfTaRe".indexOf(possibleSymbol) >= 0) ||