Skip to content

Commit

Permalink
Upper case the first character to also properly recognize lower cased…
Browse files Browse the repository at this point in the history
… 'aromatic' two-character element symbols (fixes SMILES parsign of things like c1[se]ccccc1

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Aug 29, 2010
1 parent 394f9ed commit 3ec1480
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/org/openscience/cdk/smiles/SmilesParser.java
Expand Up @@ -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) ||
Expand Down

0 comments on commit 3ec1480

Please sign in to comment.