Indigo icon indicating copy to clipboard operation
Indigo copied to clipboard

Need more reliable algorithm of recognizing the input format

Open SunFellow opened this issue 4 years ago • 0 comments

pr#224 aftermath. There was a discussion about the point where we can say that the input format is detected or failed to be detected. General approach is to pass through the set of parsers and if none is successful then issue an error. So may we issue an error from a specific parser that is treated as final fail?

================================ Originally posted by @even1024 in https://github.com/epam/Indigo/pull/224#discussion_r575266008

Not a lot of chemical formats has "{" and "molecule" then. So in most cases when we get corrupted KET-file "Error at parsing JSON" will appear which is correct behaviour. There are two options how to make the code better:

  1. Remove throw Error("Error at parsing JSON: %s", buf.ptr()) to give a try to interpret the data as some other format and let it fail somewhere else which will tangle the error diagnostic.

  2. Implement more reliable KET-detection - it makes sense when we'll have some other chemical data format with "{" and "molecule".

SunFellow avatar Feb 24 '21 18:02 SunFellow