@datagrok-libraries/chem-meta
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -7,3 +7,3 @@ { | ||
"friendlyName": "Datagrok chem-meta library", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "", | ||
@@ -10,0 +10,0 @@ "dependencies": { |
@@ -5,2 +5,3 @@ export declare const R = 82; | ||
export declare const S_QUOTE = 39; | ||
export declare const ASTERISK = 42; | ||
//# sourceMappingURL=const.d.ts.map |
@@ -5,2 +5,3 @@ export const R = 82; | ||
export const S_QUOTE = 39; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb25zdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDO0FBQ3BCLE1BQU0sQ0FBQyxNQUFNLENBQUMsR0FBRyxFQUFFLENBQUM7QUFDcEIsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFHLEVBQUUsQ0FBQztBQUMxQixNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsRUFBRSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IFIgPSA4MjtcbmV4cG9ydCBjb25zdCBMID0gNzY7XG5leHBvcnQgY29uc3QgRF9RVU9URSA9IDM0O1xuZXhwb3J0IGNvbnN0IFNfUVVPVEUgPSAzOTtcbiJdfQ== | ||
export const ASTERISK = 42; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb25zdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDO0FBQ3BCLE1BQU0sQ0FBQyxNQUFNLENBQUMsR0FBRyxFQUFFLENBQUM7QUFDcEIsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFHLEVBQUUsQ0FBQztBQUMxQixNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsRUFBRSxDQUFDO0FBQzFCLE1BQU0sQ0FBQyxNQUFNLFFBQVEsR0FBRyxFQUFFLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgUiA9IDgyO1xuZXhwb3J0IGNvbnN0IEwgPSA3NjtcbmV4cG9ydCBjb25zdCBEX1FVT1RFID0gMzQ7XG5leHBvcnQgY29uc3QgU19RVU9URSA9IDM5O1xuZXhwb3J0IGNvbnN0IEFTVEVSSVNLID0gNDI7XG4iXX0= |
@@ -17,4 +17,5 @@ import { ChemicalTableParserBase, AtomAndBondCounts } from './chemical-table-parser-base'; | ||
isQuery(): boolean; | ||
protected queryCriterion(idx: number): boolean; | ||
isFragment(): boolean; | ||
protected isQueryOrFragment(condition: (char: number, idx: number) => boolean): boolean; | ||
} | ||
//# sourceMappingURL=molfile-handler-base.d.ts.map |
import { ChemicalTableParserBase } from './chemical-table-parser-base'; | ||
import { D_QUOTE, L, R, S_QUOTE } from './const'; | ||
import { ASTERISK, D_QUOTE, L, R, S_QUOTE } from './const'; | ||
import { isAlpha } from './utils'; | ||
@@ -33,2 +33,15 @@ export class MolfileHandlerBase extends ChemicalTableParserBase { | ||
isQuery() { | ||
return this.isQueryOrFragment((char, idx) => { | ||
return char === S_QUOTE || char === D_QUOTE || | ||
(char === L && !isAlpha(this.fileContent.charCodeAt(idx + 1))); | ||
}); | ||
} | ||
; | ||
isFragment() { | ||
return this.isQueryOrFragment((char) => { | ||
return char === R || char === ASTERISK; | ||
}); | ||
} | ||
; | ||
isQueryOrFragment(condition) { | ||
const atomCount = this.atomCount; | ||
@@ -38,3 +51,4 @@ let idx = this.getAtomBlockIdx(); | ||
idx = this.shiftIdxToAtomType(idx); | ||
if (this.queryCriterion(idx)) | ||
const char = this.fileContent.charCodeAt(idx); | ||
if (condition(char, idx)) | ||
return true; | ||
@@ -46,8 +60,3 @@ idx = this.getNextLineIdx(idx); | ||
; | ||
queryCriterion(idx) { | ||
const char = this.fileContent.charCodeAt(idx); | ||
return char === R || !isAlpha(char) || | ||
(char === L && !isAlpha(this.fileContent.charCodeAt(idx + 1))); | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9sZmlsZS1oYW5kbGVyLWJhc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJtb2xmaWxlLWhhbmRsZXItYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsdUJBQXVCLEVBQW9CLE1BQU0sOEJBQThCLENBQUM7QUFDeEYsT0FBTyxFQUFFLE9BQU8sRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLE9BQU8sRUFBRSxNQUFNLFNBQVMsQ0FBQztBQUNqRCxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBRWxDLE1BQU0sT0FBZ0Isa0JBQW1CLFNBQVEsdUJBQXVCO0lBQ3RFLFlBQVksT0FBZTtRQUN6QixLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDZixJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ3JCLENBQUM7SUFFUyxJQUFJLENBQUMsT0FBZTtRQUM1QixLQUFLLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ3RCLENBQUM7SUFXUyxhQUFhLENBQUMsR0FBVztRQUNqQyxJQUFJLEtBQUssR0FBRyxHQUFHLENBQUM7UUFDaEIsSUFBSSxHQUFHLEdBQUcsS0FBSyxDQUFDO1FBQ2hCLElBQUksSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsRUFBRTtZQUN2QixHQUFHL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bnVtYmVyLCBpZHg6IG51bWJlcikgPT4ge1xuICAgICAgcmV0dXJuIGNoYXIgPT09IFNfUVVPVEUgfHwgY2hhciA9PT0gRF9RVU9URSB8fFxuICAgICAgKGNoYXIgPT09IEwgJiYgIWlzQWxwaGEodGhpcy5maWxlQ29udGVudC5jaGFyQ29kZUF0KGlkeCArIDEpKSlcbiAgICB9KVxuICB9O1xuXG4gIHB1YmxpYyBpc0ZyYWdtZW50KCk6IGJvb2xlYW4ge1xuICAgIHJldHVybiB0aGlzLmlzUXVlcnlPckZyYWdtZW50KChjaGFyOiBudW1iZXIpID0+IHtcbiAgICAgIHJldHVybiBjaGFyID09PSBSIHx8IGNoYXIgPT09IEFTVEVSSVNLO1xuICAgIH0pXG4gIH07XG5cbiAgcHJvdGVjdGVkIGlzUXVlcnlPckZyYWdtZW50KGNvbmRpdGlvbjogKGNoYXI6IG51bWJlciwgaWR4OiBudW1iZXIpID0+IGJvb2xlYW4pOiBib29sZWFuIHtcbiAgICBjb25zdCBhdG9tQ291bnQgPSB0aGlzLmF0b21Db3VudDtcbiAgICBsZXQgaWR4ID0gdGhpcy5nZXRBdG9tQmxvY2tJZHgoKTtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGF0b21Db3VudDsgaSsrKSB7XG4gICAgICBpZHggPSB0aGlzLnNoaWZ0SWR4VG9BdG9tVHlwZShpZHgpO1xuICAgICAgY29uc3QgY2hhciA9IHRoaXMuZmlsZUNvbnRlbnQuY2hhckNvZGVBdChpZHgpO1xuICAgICAgaWYgKGNvbmRpdGlvbihjaGFyLCBpZHgpKVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIGlkeCA9IHRoaXMuZ2V0TmV4dExpbmVJZHgoaWR4KTtcbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufVxuIl19 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
85549
711