<commit_before>import DocumentArchive from './DocumentArchive'
import InMemoryDarBuffer from './InMemoryDarBuffer'

export default function loadArchive (rawArchive, config) {
  const archive = new DocumentArchive(
    // Note: this is a minimalistic Storage adapter with only `read()` implemented
    {
      read (_, cb) {
        cb(null, rawArchive)
      }
    },
    new InMemoryDarBuffer(),
    {},
    config
  )
  // Note: we are using a synchronous store here (in memory)
  // so this is actually synchronous
  archive.load(null, err => {
    if (err) {
      console.error(err)
    }
  })
  return archive
}<commit_msg>Add a writer to stub loaded archive.<commit_after>import DocumentArchive from './DocumentArchive'
import InMemoryDarBuffer from './InMemoryDarBuffer'

export default function loadArchive (rawArchive, config) {
  const archive = new DocumentArchive(
    // Note: this is a minimalistic Storage adapter with only `read()` implemented
    {
      read (_, cb) {
        cb(null, rawArchive)
      },
      write (_, __, cb) {
        cb()
      }
    },
    new InMemoryDarBuffer(),
    {},
    config
  )
  // Note: we are using a synchronous store here (in memory)
  // so this is actually synchronous
  archive.load(null, err => {
    if (err) {
      console.error(err)
    }
  })
  return archive
}
{'fraction_non_alphanumeric': 0.1053423626787058, 'fraction_numerical': 0.0, 'mean_word_length': 2.7464788732394365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1731375', 'n_tokens_mistral': 398, 'n_tokens_neox': 372, 'n_words': 125}