Read the SMILES given in the input line - or return an empty container.

@param line input line
@return the read container (or an empty one)
8204
private IAtomContainer readSmiles(final String line) {
        try {
            return sp.parseSmiles(line);
        } catch (CDKException e) {
            logger.error("Error while reading the SMILES from: " + line + ", ", e);
            final IAtomContainer empty = builder.newInstance(IAtomContainer.class, 0, 0, 0, 0);
            empty.setProperty(BAD_SMILES_INPUT, line);
            return empty;
        }
    }
895971
function getActualLineIndentText(line) {
            let actualText = actualLineIndentTexts.get(line)
            if (actualText === undefined) {
                const lineText = getLineText(line)
                const index = lineText.search(/\S/u)
                if (index >= 0) {
                    actualText = lineText.slice(0, index)
                } else {
                    actualText = lineText
                }
                actualLineIndentTexts.set(line, actualText)
            }
            return actualText
        }
842523
public List<String> parse(String line) throws ParseException {
    List<String> cols = new ArrayList<>();
    boolean afterQuote = false;
    boolean afterEscape = false;
    boolean afterSeparator = false;
    boolean outerQuote = false;
    boolean afterEndField = false;
    StringBuilder sb = new StringBuilder();

    for (int i = 0; ; ++i) {
      char c = (i == line.length()) ? EOT : line.charAt(i);
      if (afterEndField && c != separator && c != EOT) {
        if (!trim || c != ' ') {
          throw new ParseException("Extraneous character after end of quoted field", i);
        }
      } else if (afterEscape) {
        if (c == EOT) {
          // [abc\^]
          throw new ParseException("Escape not followed by a character", i);
        } else {
          // [abc\x...] => abcx...
          afterEscape = false;
          sb.append(c);
        }
      } else if (c == separator) {
        if (outerQuote && !afterQuote) {
          // ["abc,...] => abc,...
          sb.append(c);
          afterSeparator = false;
        } else {
          // [abc,...] => {abc, ...}
          endCol(cols, sb, i, outerQuote, afterQuote);
          afterQuote = afterEscape = afterEndField = outerQuote = false;
          afterSeparator = true;
        }
      } else if (c == EOT) {
        if (sb.length() != 0 || afterSeparator || outerQuote) {
          // [...,abc^] => {..., abc}
          // [...,^] => {..., ""}
          endCol(cols, sb, i, outerQuote, afterQuote);
        }
        return cols;
      } else if (c == escape) {
        // [...\...]
        afterEscape = true;
        afterSeparator = false;
      } else if (c == quote) {
        if (afterQuote && outerQuote) {
          // Two consecutive quotes inside quoted string, so the pair has to be internal
          // (the second quote cannot be terminating the field).
          sb.append(quote);
          afterQuote = false;
        } else if (sb.length() == 0 && !outerQuote) {
          outerQuote = true;
        } else if (sb.length() != 0 && !outerQuote) {
          // Fields that are not quote-delimited cannot have any internal quotes,
          // unless they are escaped which was already handled.
          throw new ParseException(escape == NUL
              ? "Unescaped quote inside non-quote-delimited field"
              : "Quote inside non-quote-delimited field",
              i);
        } else {
          afterQuote = true;
        }
        afterSeparator = false;
      } else if (c == ' ' && trim
          && ((!outerQuote && sb.length() == 0) // Trimmed space before field
              || afterEndField)) {              // Trimmed space after field
      } else if (c == ' ' && trim && afterQuote) {
        afterEndField = true;
      } else if (outerQuote && afterQuote) {
        // ["abc"x]
        throw new ParseException("Extraneous character after end of quoted field", i);
      } else {
        // Common character.
        sb.append(c);
        afterSeparator = false;
      }
    }
  }
816795
public static String[] parseLine(String line) {
        boolean insideQuote = false;
        List<String> result = new ArrayList<>();
        StringBuilder builder = new StringBuilder();
        int quoteCount = 0;

        for (int i = 0; i < line.length(); i++) {
            char c = line.charAt(i);

            if (c == QUOTE) {
                insideQuote = !insideQuote;
                quoteCount++;
            }

            if (c == COMMA && !insideQuote) {
                String value = builder.toString();
                value = unescape(value);

                result.add(value);
                builder = new StringBuilder();
                continue;
            }

            builder.append(c);
        }

        result.add(builder.toString());

        if (quoteCount % 2 != 0) {
            throw new RuntimeException("Unmatched quote in entry: " + line);
        }

        return result.toArray(new String[result.size()]);
    }
335397
protected boolean parseEmptyOrCommentLine(final ParserData parserData, final String line) {
        if (isBlankLine(line)) {
            if (parserData.getCurrentLevel().getLevelType() == LevelType.BASE) {
                parserData.getContentSpec().appendChild(new TextNode("\n"));
            } else {
                parserData.getCurrentLevel().appendChild(new TextNode("\n"));
            }
            return true;
        } else {
            if (parserData.getCurrentLevel().getLevelType() == LevelType.BASE) {
                parserData.getContentSpec().appendComment(line);
            } else {
                parserData.getCurrentLevel().appendComment(line);
            }
            return true;
        }
    }
1255069
private IAtomContainerSet readAtomContainerSet(IAtomContainerSet som) {
        try {
            String line = input.readLine().trim();
            while (line != null) {
                logger.debug("Line: ", line);

                final String name = suffix(line);

                try {
                    IAtomContainer molecule = sp.parseSmiles(line);
                    molecule.setProperty("SMIdbNAME", name);
                    som.addAtomContainer(molecule);
                } catch (CDKException exception) {
                    logger.warn("This SMILES could not be parsed: ", line);
                    logger.warn("Because of: ", exception.getMessage());
                    logger.debug(exception);
                    IAtomContainer empty = som.getBuilder().newInstance(IAtomContainer.class, 0, 0, 0, 0);
                    empty.setProperty(IteratingSMILESReader.BAD_SMILES_INPUT, line);
                    som.addAtomContainer(empty);
                }
                if (input.ready()) {
                    line = input.readLine();
                } else {
                    line = null;
                }
            }
        } catch (Exception exception) {
            logger.error("Error while reading SMILES line: ", exception.getMessage());
            logger.debug(exception);
        }
        return som;
    }
325112
public boolean isLastHeaderLine(String line) {
        return lastLineDetectionPattern != null && line != null && lastLineDetectionPattern.matcher(line).matches();
    }
498743
public static String[] disectCommandLine(String line) {
		return StringSupport.split(line, "() ,;", "\"", false, false, false).toArray(new String[0]);
	}
619359
public static CaptureSearchResult parseCDXLineFlexFast(String line) {	
		CaptureSearchResult result = new FastCaptureSearchResult();
		return parseCDXLineFlex(line, result);
	}
685674
protected static String[] parseValues (String line)
    {
        String value = parseValue(line);
        if (StringUtil.isBlank(value)) {
            return null;
        }

        String[] values = StringUtil.split(value, ",");
        for (int ii = 0; ii < values.length; ii++) {
            values[ii] = values[ii].trim();
        }
        return values;
    }
282740
public int getPosition(int line) {
        int result = -1;
        try {
            result = textArea.getLineStartOffset(line);
        } catch (javax.swing.text.BadLocationException exc) {
        }
        return result;
    }
1126984
public static String getIndent(String line) {
        if (line == null || line.length() == 0) {
            return "";
        }
        int i = 0;
        while (i < line.length() && line.charAt(i) == '\t') {
            i++;
        }
        return line.substring(0, i);
    }
101456
private String getTextLine(String[] textLines, int line)
	{
		return (isIgnoreTrailingWhiteSpaces()) ? textLines[line].trim() : textLines[line];
	}
1132064
protected String transform(String line) {
        ignoreLine.reset(line);
        if(ignoreLine.matches()) {
            return null; 
        }
        extractLine.reset(line);
        if(extractLine.matches()) {
            StringBuffer output = new StringBuffer();
            // TODO: consider if a loop that find()s all is more 
            // generally useful here
            extractLine.appendReplacement(output,outputTemplate);
            return output.toString();
        }
        // no match; possibly error
        logger.warning("line not extracted nor no-op: "+line);
        return null;
    }
1122203
public String getHashForLine(int line) {
    if (line > 0 && line <= hashes.size()) {
      return Strings.nullToEmpty(hashes.get(line - 1));
    }
    return "";
  }
658002
async def readline(self, container = None, size = None):
        
        ret = []
        retsize = 0
        if self.eof:
            raise EOFError
        if self.errored:
            raise IOError('Stream is broken before EOF')
        while size is None or retsize < size:
            if self.pos >= len(self.data):
                await self.prepareRead(container)
            if size is None or size - retsize >= len(self.data) - self.pos:
                t = self.data[self.pos:]
                if self.isunicode:
                    p = t.find(u'\n')
                else:
                    p = t.find(b'\n')
                if p >= 0:
                    t = t[0: p + 1]
                    ret.append(t)
                    retsize += len(t)
                    self.pos += len(t)
                    break
                else:
                    ret.append(t)
                    retsize += len(t)
                    self.pos += len(t)
                    if self.dataeof:
                        self.eof = True
                        break
                    if self.dataerror:
                        self.errored = True
                        break
            else:
                t = self.data[self.pos:self.pos + (size - retsize)]
                if self.isunicode:
                    p = t.find(u'\n')
                else:
                    p = t.find(b'\n')
                if p >= 0:
                    t = t[0: p + 1]
                ret.append(t)
                self.pos += len(t)
                retsize += len(t)
                break
        if self.isunicode:
            return u''.join(ret)
        else:
            return b''.join(ret)
        if self.errored:
            raise IOError('Stream is broken before EOF')
1243786
private LinkedList<String> toDisplayLines(String line) {
        LinkedList<String> displayLines = new LinkedList<String>();
        if (line.length() <= terminal.getWidth()) {
            displayLines.add(line);
        } else {
            int total = Math.max(0, line.length() - 1) / terminal.getWidth() + 1;
            int startIndex = 0;
            for (int l = 0; l < total; l++) {
                displayLines.add(line.substring(startIndex, Math.min(startIndex + terminal.getWidth(), line.length())));
                startIndex += terminal.getWidth();
            }
        }
        return displayLines;
    }