<commit_before>'use strict';

const { readFileSync } = require('fs');
const { join } = require('path');

const { Molecule } = require('../../dist/openchemlib-full.pretty');

const molfile = readFileSync(join(__dirname, 'molfile.txt'), 'utf8');
const molecule = Molecule.fromMolfile(molfile);
console.log('molecule', molecule.getAllAtoms());

const molfileNoSGroup = readFileSync(
  join(__dirname, 'molfileNoSGroup.txt'),
  'utf8',
);
const moleculeNoSGroup = Molecule.fromMolfile(molfileNoSGroup);
console.log('moleculeNoSGroup', moleculeNoSGroup.getAllAtoms());

const molfileV2000 = readFileSync(join(__dirname, 'molfileV2000.txt'), 'utf8');
const moleculeV2000 = Molecule.fromMolfile(molfileV2000);
console.log('moleculeV2000', moleculeV2000.getAllAtoms());<commit_msg>chore: add hacked molfile example<commit_after>'use strict';

const { readFileSync } = require('fs');
const { join } = require('path');

const { Molecule } = require('../../dist/openchemlib-full.pretty');

const molfile = readFileSync(join(__dirname, 'molfile.txt'), 'utf8');
const molecule = Molecule.fromMolfile(molfile);
console.log('molecule', molecule.getAllAtoms());

const molfileHacked = readFileSync(
  join(__dirname, 'molfile.txt'),
  'utf8',
).replace(
  /M {2}V30 BEGIN SGROUP[\r\n]+(.*[\r\n]+)*M {2}V30 END SGROUP[\r\n]+/,
  '',
);
const moleculeHacked = Molecule.fromMolfile(molfileHacked);
console.log('moleculeHacked', moleculeHacked.getAllAtoms());

const molfileNoSGroup = readFileSync(
  join(__dirname, 'molfileNoSGroup.txt'),
  'utf8',
);
const moleculeNoSGroup = Molecule.fromMolfile(molfileNoSGroup);
console.log('moleculeNoSGroup', moleculeNoSGroup.getAllAtoms());

const molfileV2000 = readFileSync(join(__dirname, 'molfileV2000.txt'), 'utf8');
const moleculeV2000 = Molecule.fromMolfile(molfileV2000);
console.log('moleculeV2000', moleculeV2000.getAllAtoms());
{'fraction_non_alphanumeric': 0.16720430107526882, 'fraction_numerical': 0.032795698924731186, 'mean_word_length': 7.271111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4701607', 'n_tokens_mistral': 719, 'n_tokens_neox': 634, 'n_words': 106}