10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-04 21:24:00 +01:00
QUESTDB_website/static/js/GeometryParseMetadataExtension.js

20 lines
531 B
JavaScript
Raw Normal View History

2020-09-28 15:39:46 +02:00
if (!Geometry.prototype.parseMetadata) {
Geometry.prototype.parseMetadata = function () {
const Ametadata = this.comment.split(",")
const molecule = Ametadata[0]
const stateRegExp = /^\^(\d+)(.+)$/
const m = Ametadata[1].match(stateRegExp)
2020-09-30 14:09:44 +02:00
const mul = parseInt(m[1],10)
2020-09-28 15:39:46 +02:00
const sym = m[2]
var meth = null
if (Ametadata.length>2) {
meth = new method(Ametadata[2],Ametadata[3])
}
return {
molecule:molecule,
multiplicity:mul,
symmetry:sym,
method:meth
}
}
}